Skip to content

Commit

Permalink
Merge pull request #1358 from maykinmedia/fix-communication-choices
Browse files Browse the repository at this point in the history
Fix admin for notification channel choice
  • Loading branch information
swrichards authored and pi-sigma committed Aug 20, 2024
2 parents 0b35278 + 91cade3 commit 5643244
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 15 deletions.
9 changes: 5 additions & 4 deletions src/open_inwoner/configurations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,14 @@ class SiteConfigurationAdmin(OrderedInlineModelAdminMixin, SingletonModelAdmin):
_("Notifications"),
{
"fields": (
"enable_notification_channel_choice",
"notifications_cases_enabled",
"notifications_messages_enabled",
"notifications_actions_enabled",
"notifications_plans_enabled",
"notifications_cases_enabled",
"recipients_email_digest",
"contact_phonenumber",
"notifications_actions_enabled",
"email_verification_required",
"contact_phonenumber",
"recipients_email_digest",
)
},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated by Django 4.2.15 on 2024-08-20 08:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("configurations", "0071_correct_siteconfiguration"),
]

operations = [
migrations.AlterField(
model_name="siteconfiguration",
name="notifications_actions_enabled",
field=models.BooleanField(
default=True,
help_text="Enable notifications for expring actions concerning plans (if enabled, individual users can opt out by disabling notifications for plans)",
verbose_name="User notifications for expiring actions",
),
),
migrations.AlterField(
model_name="siteconfiguration",
name="notifications_cases_enabled",
field=models.BooleanField(
default=True,
help_text="Enable notifications for case updates (if enabled, individual users can still opt out; messages will only be sent if the user also opts in)",
verbose_name="User notifications for cases",
),
),
migrations.AlterField(
model_name="siteconfiguration",
name="notifications_messages_enabled",
field=models.BooleanField(
default=True,
help_text="Enable notifications for messages (if enabled, individual users can still opt out)",
verbose_name="User notifications for messages",
),
),
migrations.AlterField(
model_name="siteconfiguration",
name="notifications_plans_enabled",
field=models.BooleanField(
default=True,
help_text="Enable notifications for plans (if enabled, individual users can still opt out)",
verbose_name="User notifications for expiring plans",
),
),
]
23 changes: 12 additions & 11 deletions src/open_inwoner/configurations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,33 +367,34 @@ class SiteConfiguration(SingletonModel):
"(digital and post or digital only)"
),
)
notifications_messages_enabled = models.BooleanField(
verbose_name=_("User notifications for messages"),
notifications_cases_enabled = models.BooleanField(
verbose_name=_("User notifications for cases"),
default=True,
help_text=_(
"Notify users of new messages (if set, individual users can still opt out)"
"Enable notifications for case updates (if enabled, individual users can still opt out; "
"messages will only be sent if the user also opts in)"
),
)
notifications_actions_enabled = models.BooleanField(
verbose_name=_("User notifications for expiring actions"),
notifications_messages_enabled = models.BooleanField(
verbose_name=_("User notifications for messages"),
default=True,
help_text=_(
"Notify users of expiring actions (if set, individual users can still opt out)"
"Enable notifications for messages (if enabled, individual users can still opt out)"
),
)
notifications_plans_enabled = models.BooleanField(
verbose_name=_("User notifications for expiring plans"),
default=True,
help_text=_(
"Notify users of expiring plans (if set, individual users can still opt out)"
"Enable notifications for plans (if enabled, individual users can still opt out)"
),
)
notifications_cases_enabled = models.BooleanField(
verbose_name=_("User notifications for cases"),
notifications_actions_enabled = models.BooleanField(
verbose_name=_("User notifications for expiring actions"),
default=True,
help_text=_(
"Notify users of updates to cases or if an action is required "
"(if set, individual users can still opt out)"
"Enable notifications for expring actions concerning plans (if enabled, individual users "
"can still opt out by disabling notifications for plans)"
),
)
recipients_email_digest = ArrayField(
Expand Down

0 comments on commit 5643244

Please sign in to comment.