From a967eece26c24c931704e78e6ab0a3b44e9c5ae0 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 1 Dec 2023 16:48:12 +0200 Subject: [PATCH] show event music toggle to everyone and give error --- files/routes/settings.py | 4 +++- files/templates/settings/personal.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index d8532f962d..d38c331adb 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -193,7 +193,9 @@ def settings_personal_post(v): updated = True session["nsfw_warnings"] = int(request.values.get("nsfw_warnings") == 'true') - elif not updated and IS_EVENT() and v.can_toggle_event_music and request.values.get("event_music", v.event_music) != v.event_music: + elif not updated and IS_EVENT() and request.values.get("event_music", v.event_music) != v.event_music: + if not v.can_toggle_event_music: + abort(403, "You need to award yourself the grinch award to be able to disable event music!") updated = True session['event_music'] = request.values.get("event_music", v.event_music) == 'true' diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index 2eea544ffe..00f7612cda 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -7,7 +7,7 @@
Site Experience
- {% if IS_EVENT() and v.can_toggle_event_music %} + {% if IS_EVENT() %} {{common.toggle_section('Event Music', 'event_music_switch', 'event_music', v.event_music, 'Toggle event music.', false)}} {% endif %}