From 6a57ef6d16daf38de9146cdc7f4c9561a4179e8e Mon Sep 17 00:00:00 2001 From: Dominik Szopa Date: Sun, 8 Mar 2020 12:08:51 -0700 Subject: [PATCH] Changed message fields to TextField for easier editing in admin console --- TODO | 9 +++-- team_fundraising/admin.py | 1 - .../migrations/0020_auto_20200308_1152.py | 35 +++++++++++++++++++ .../migrations/0021_auto_20200308_1156.py | 18 ++++++++++ .../migrations/0022_auto_20200308_1207.py | 23 ++++++++++++ team_fundraising/models.py | 6 ++-- 6 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 team_fundraising/migrations/0020_auto_20200308_1152.py create mode 100644 team_fundraising/migrations/0021_auto_20200308_1156.py create mode 100644 team_fundraising/migrations/0022_auto_20200308_1207.py diff --git a/TODO b/TODO index 19008c1..3cce989 100644 --- a/TODO +++ b/TODO @@ -129,15 +129,18 @@ [x] Fix bug when clicking 'Edit' in campaign you are not part of yet [x] Create better homepage [x] Make non-specific campaign go to latest - [ ] Test with one campaign - [ ] Create email signup invite, including to add to campaign + [x] Test with one campaign [x] Add filters for campaign to admin page [ ] Update and add tests +[x] Optimize home page queries [x] Remove special characters from spreadsheet export [ ] Store campaign image in database +[ ] Automatically sign up for fundraising when registering on Squarespace + [ ] Research Squarespace API + [ ] Plan out implementation + [ ] Create email signup invite, including to add to campaign [ ] Auto login after password change [ ] Add Javascript warning about low security password [UT1 2.3] -[x] Optimize home page queries [ ] Make default fundraiser amount configurable [ ] Add name to tax receipt information [ ] Change email links to HTTPS diff --git a/team_fundraising/admin.py b/team_fundraising/admin.py index 9817db4..e256af3 100644 --- a/team_fundraising/admin.py +++ b/team_fundraising/admin.py @@ -10,7 +10,6 @@ class CampaignAdmin(admin.ModelAdmin): # Register your models here. - admin.site.register(Campaign) admin.site.register(Fundraiser) diff --git a/team_fundraising/migrations/0020_auto_20200308_1152.py b/team_fundraising/migrations/0020_auto_20200308_1152.py new file mode 100644 index 0000000..9b071f7 --- /dev/null +++ b/team_fundraising/migrations/0020_auto_20200308_1152.py @@ -0,0 +1,35 @@ +# Generated by Django 2.2.10 on 2020-03-08 18:52 + +import django.contrib.auth.models +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('auth', '0011_update_proxy_permissions'), + ('team_fundraising', '0019_auto_20191221_0101'), + ] + + operations = [ + migrations.CreateModel( + name='ProxyUser', + fields=[ + ], + options={ + 'verbose_name': 'UserProxy', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('auth.user',), + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.AlterField( + model_name='campaign', + name='campaign_message', + field=models.TextField(max_length=5000), + ), + ] diff --git a/team_fundraising/migrations/0021_auto_20200308_1156.py b/team_fundraising/migrations/0021_auto_20200308_1156.py new file mode 100644 index 0000000..8f94966 --- /dev/null +++ b/team_fundraising/migrations/0021_auto_20200308_1156.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.10 on 2020-03-08 18:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('team_fundraising', '0020_auto_20200308_1152'), + ] + + operations = [ + migrations.AlterField( + model_name='campaign', + name='campaign_message', + field=models.TextField(), + ), + ] diff --git a/team_fundraising/migrations/0022_auto_20200308_1207.py b/team_fundraising/migrations/0022_auto_20200308_1207.py new file mode 100644 index 0000000..9e2258e --- /dev/null +++ b/team_fundraising/migrations/0022_auto_20200308_1207.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.10 on 2020-03-08 19:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('team_fundraising', '0021_auto_20200308_1156'), + ] + + operations = [ + migrations.AlterField( + model_name='campaign', + name='default_fundraiser_message', + field=models.TextField(), + ), + migrations.AlterField( + model_name='fundraiser', + name='message', + field=models.TextField(blank=True), + ), + ] diff --git a/team_fundraising/models.py b/team_fundraising/models.py index b8f73c3..ef561b5 100644 --- a/team_fundraising/models.py +++ b/team_fundraising/models.py @@ -20,8 +20,8 @@ class Campaign(models.Model): name = models.CharField(max_length=50) goal = models.IntegerField(default=0) active = models.BooleanField(default=True) - campaign_message = models.CharField(max_length=5000) - default_fundraiser_message = models.CharField(max_length=5000) + campaign_message = models.TextField() + default_fundraiser_message = models.TextField() def __str__(self): return self.name @@ -116,7 +116,7 @@ class Fundraiser(models.Model): name = models.CharField(max_length=50) goal = models.IntegerField(default=0, blank=True) photo = models.ImageField(upload_to='photos/', blank=True) - message = models.CharField(max_length=5000, blank=True) + message = models.TextField(blank=True) def __str__(self): return self.name