diff --git a/hypha/apply/funds/forms.py b/hypha/apply/funds/forms.py index 8221975df32e4dedd706ad4c57ca70b19c490ca6..cf7f03ac9e2058d6f9523ecf3d74753c52ba8f0e 100644 --- a/hypha/apply/funds/forms.py +++ b/hypha/apply/funds/forms.py @@ -432,4 +432,4 @@ class CreateReminderForm(forms.ModelForm): class Meta: model = Reminder - fields = ['time', 'action', 'medium'] + fields = ['time', 'action'] diff --git a/hypha/apply/funds/migrations/0073_reminder.py b/hypha/apply/funds/migrations/0073_reminder.py index 5ec67fc4a94ced6df26725f1893bbc2db3be981a..247398da79e669421e4d7b54b290fb47e3fc53b3 100644 --- a/hypha/apply/funds/migrations/0073_reminder.py +++ b/hypha/apply/funds/migrations/0073_reminder.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.11 on 2020-03-19 12:31 +# Generated by Django 2.2.11 on 2020-03-19 17:28 from django.conf import settings from django.db import migrations, models @@ -19,7 +19,6 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('time', models.DateTimeField()), ('action', models.CharField(choices=[('reviewers_review', 'Remind reviewers to Review')], default='reviewers_review', max_length=50)), - ('medium', models.CharField(choices=[('email', 'Email')], default='email', max_length=15)), ('sent', models.BooleanField(default=False)), ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reminders', to='funds.ApplicationSubmission')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), diff --git a/hypha/apply/funds/models/reminders.py b/hypha/apply/funds/models/reminders.py index 1015a965c1940a3da7c76a9830a501c5eb2fa7e2..e31be93d2c8a30be1dd5c7bce8349dc160baeee8 100644 --- a/hypha/apply/funds/models/reminders.py +++ b/hypha/apply/funds/models/reminders.py @@ -11,8 +11,8 @@ class Reminder(models.Model): REVIEW: 'Remind reviewers to Review', } EMAIL = 'email' - MEDIUM_TYPES = { - EMAIL: 'Email', + MEDIUM = { + REVIEW: EMAIL } ACTION_MESSAGE = { f'{REVIEW}-{EMAIL}': MESSAGES.REVIEW_REMINDER, @@ -32,11 +32,6 @@ class Reminder(models.Model): default=REVIEW, max_length=50, ) - medium = models.CharField( - choices=MEDIUM_TYPES.items(), - default=EMAIL, - max_length=15, - ) sent = models.BooleanField(default=False) def __str__(self): @@ -52,3 +47,8 @@ class Reminder(models.Model): @property def action_message(self): return self.ACTION_MESSAGE[f'{self.action}-{self.medium}'] + + @property + def medium(self): + return self.MEDIUM[self.action] + \ No newline at end of file