Hide the cancel button and add title/subtitle to notification page

This commit is contained in:
2022-12-18 17:27:40 +00:00
parent 7ee698f457
commit 246674b03e
3 changed files with 31 additions and 6 deletions

View File

@@ -11,6 +11,11 @@ class NotificationsUpdate(LoginRequiredMixin, ObjectUpdate):
model = NotificationSettings
form_class = NotificationSettingsForm
page_title = "Update your notification settings."
page_subtitle = (
"At least the topic must be set if you want to receive notifications."
)
# list_url_name = "notifications"
# list_url_args = ["type"]
@@ -19,6 +24,8 @@ class NotificationsUpdate(LoginRequiredMixin, ObjectUpdate):
pk_required = False
hide_cancel = True
def get_object(self, **kwargs):
notification_settings, _ = NotificationSettings.objects.get_or_create(
user=self.request.user