Skip to content

Commit

Permalink
The notification delay can now be configured by each user in its profile
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe committed Nov 21, 2024
1 parent f7f16fb commit d8c0592
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dashboard/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ class EditProfileForm(CommonUsersFields, UserChangeForm):
# No password change on the profile form
password = None # type: ignore

notification_delay_days = forms.IntegerField(
label=_("Notification delay"),
help_text=_(
"Observations older than this number of days will be automatically considered as 'seen'"
),
)

class Meta(CommonUsersFields.Meta):
fields = CommonUsersFields.Meta.fields + ("notification_delay_days",)

def __init__(self, *args, **kwargs):
super(UserChangeForm, self).__init__(*args, **kwargs)
self.fields["username"].disabled = True # Username is readonly
Expand Down

0 comments on commit d8c0592

Please sign in to comment.