Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TWLight/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def __init__(self, user, *args, **kwargs):

class UserEmailForm(forms.Form):
send_renewal_notices = forms.BooleanField(required=False)
enable_suggestion_notification = forms.BooleanField(required=False)

def __init__(self, user, *args, **kwargs):
super(UserEmailForm, self).__init__(*args, **kwargs)
Expand All @@ -110,6 +111,13 @@ def __init__(self, user, *args, **kwargs):
"send_renewal_notices"
# Translators: In the preferences section (Emails) of a user profile, this text labels the checkbox users can (un)click to change if they wish to receive account renewal notices or not.
].label = _("Send renewal notices")
self.fields[
"enable_suggestion_notification"
].initial = user.userprofile.enable_suggestion_notification
self.fields[
"enable_suggestion_notification"
# Translators: In the preferences section (Emails) of a user profile, this text labels the checkbox users can (un)click to change if they wish to receive suggestion notifications.
].label = _("Send notices when upvoted suggestions become available")


class CoordinatorEmailForm(forms.Form):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.18 on 2023-05-19 12:31

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("users", "0090_alter_userprofile_lang"),
]

operations = [
migrations.AddField(
model_name="userprofile",
name="enable_suggestion_notification",
field=models.BooleanField(
default=True, help_text="Does this user want suggestion notifications?"
),
),
]
3 changes: 3 additions & 0 deletions TWLight/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class Meta:
send_renewal_notices = models.BooleanField(
default=True, help_text="Does this user want renewal reminder notices?"
)
enable_suggestion_notification = models.BooleanField(
default=True, help_text="Does this user want suggestion notifications?"
)
pending_app_reminders = models.BooleanField(
default=True,
help_text="Does this coordinator want pending app reminder notices?",
Expand Down