diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index 8bace11..dea8a66 100644 Binary files a/core/__pycache__/forms.cpython-311.pyc and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 156fa51..84daac2 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py index 670ed7f..9286565 100644 --- a/core/forms.py +++ b/core/forms.py @@ -1,6 +1,7 @@ from django import forms from django.contrib.auth.models import User from .models import Voter, Interaction, Donation, VoterLikelihood, InteractionType, DonationMethod, ElectionType, Event, EventParticipation, EventType, Tenant, ParticipationStatus, Volunteer, VolunteerEvent, VolunteerRole, ScheduledCall +from core.permissions import get_user_role class Select2MultipleWidget(forms.SelectMultiple): """ @@ -83,7 +84,6 @@ class VoterForm(forms.ModelForm): if self.user.is_superuser: is_admin = True elif self.tenant: - from .permissions import get_user_role role = get_user_role(self.user, self.tenant) if role in ["admin", "system_admin", "campaign_admin"]: is_admin = True @@ -137,6 +137,8 @@ class AdvancedVoterSearchForm(forms.Form): choices=[('', 'Any')] + Voter.WINDOW_STICKER_CHOICES, required=False ) + min_total_donation = forms.DecimalField(required=False, min_value=0, label="Min Total Donation") + max_total_donation = forms.DecimalField(required=False, min_value=0, label="Max Total Donation") def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -488,5 +490,4 @@ class UserUpdateForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for field in self.fields.values(): - field.widget.attrs.update({'class': 'form-control'} -) \ No newline at end of file + field.widget.attrs.update({'class': 'form-control'}) diff --git a/core/templates/core/voter_advanced_search.html b/core/templates/core/voter_advanced_search.html index 769d26f..7f0ee6a 100644 --- a/core/templates/core/voter_advanced_search.html +++ b/core/templates/core/voter_advanced_search.html @@ -69,6 +69,14 @@ {{ form.window_sticker }} +