diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 950bfbe..eedae02 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 54e8551..2f1b65f 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index c59d399..54a0b64 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 573167d..443e142 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 51dd659..47f7a7f 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1974,4 +1974,29 @@ class VotingRecordAdmin(BaseImportAdminMixin, admin.ModelAdmin): context['form'] = form context['title'] = "Import Voting Records" context['opts'] = self.model._meta - return render(request, "admin/import_csv.html", context) \ No newline at end of file + return render(request, "admin/import_csv.html", context) +@admin.register(CampaignSettings) +class CampaignSettingsAdmin(admin.ModelAdmin): + list_display = ('tenant', 'smtp_host', 'email_from_address', 'timezone') + list_filter = ('tenant',) + search_fields = ('tenant__name', 'smtp_host', 'email_from_address') + fieldsets = ( + (None, { + 'fields': ('tenant', 'timezone', 'donation_goal') + }), + ('Twilio Settings', { + 'fields': ('twilio_account_sid', 'twilio_auth_token', 'twilio_from_number'), + 'classes': ('collapse',), + }), + ('SMTP Settings', { + 'fields': ( + 'email_from_address', + 'smtp_host', + 'smtp_port', + 'smtp_username', + 'smtp_password', + 'smtp_use_tls', + 'smtp_use_ssl', + ), + }), + ) diff --git a/core/migrations/0042_campaignsettings_email_from_address_and_more.py b/core/migrations/0042_campaignsettings_email_from_address_and_more.py new file mode 100644 index 0000000..f01bfd6 --- /dev/null +++ b/core/migrations/0042_campaignsettings_email_from_address_and_more.py @@ -0,0 +1,48 @@ +# Generated by Django 5.2.7 on 2026-02-11 15:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0041_alter_volunteer_options'), + ] + + operations = [ + migrations.AddField( + model_name='campaignsettings', + name='email_from_address', + field=models.EmailField(blank=True, max_length=254), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_host', + field=models.CharField(blank=True, max_length=255), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_password', + field=models.CharField(blank=True, max_length=255), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_port', + field=models.IntegerField(default=587), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_use_ssl', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_use_tls', + field=models.BooleanField(default=True), + ), + migrations.AddField( + model_name='campaignsettings', + name='smtp_username', + field=models.CharField(blank=True, max_length=255), + ), + ] diff --git a/core/migrations/__pycache__/0042_campaignsettings_email_from_address_and_more.cpython-311.pyc b/core/migrations/__pycache__/0042_campaignsettings_email_from_address_and_more.cpython-311.pyc new file mode 100644 index 0000000..bfd44f3 Binary files /dev/null and b/core/migrations/__pycache__/0042_campaignsettings_email_from_address_and_more.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 032d9ec..9efb0e3 100644 --- a/core/models.py +++ b/core/models.py @@ -435,6 +435,13 @@ class CampaignSettings(models.Model): twilio_auth_token = models.CharField(max_length=100, blank=True, default='89ec830d0fa02ab0afa6c76084865713') twilio_from_number = models.CharField(max_length=20, blank=True, default='+18556945903') timezone = models.CharField(max_length=100, default="America/Chicago", choices=[(tz, tz) for tz in sorted(zoneinfo.available_timezones())]) + smtp_host = models.CharField(max_length=255, blank=True) + smtp_port = models.IntegerField(default=587) + smtp_username = models.CharField(max_length=255, blank=True) + smtp_password = models.CharField(max_length=255, blank=True) + smtp_use_tls = models.BooleanField(default=True) + smtp_use_ssl = models.BooleanField(default=False) + email_from_address = models.EmailField(blank=True) class Meta: verbose_name = 'Campaign Settings' diff --git a/core/templates/core/door_visits.html b/core/templates/core/door_visits.html index 28c4ea2..c6e21e8 100644 --- a/core/templates/core/door_visits.html +++ b/core/templates/core/door_visits.html @@ -180,7 +180,14 @@ @@ -283,8 +290,50 @@ {% endblock %} \ No newline at end of file diff --git a/core/templates/core/voter_advanced_search.html b/core/templates/core/voter_advanced_search.html index 7f0ee6a..07a2ab0 100644 --- a/core/templates/core/voter_advanced_search.html +++ b/core/templates/core/voter_advanced_search.html @@ -116,6 +116,9 @@
@@ -331,6 +334,38 @@
+ +