Skip to content

Commit 554349b

Browse files
Switch off debug
1 parent d80d857 commit 554349b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

apps/dashboard/views.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,18 @@ def debug_on(django_request):
528528
config_data = model.configuration.get_config()
529529
model.database.database_init(config_data)
530530

531-
django_request.session['developer_mode'] = True
531+
allowed = person_from_request(django_request).is_administrator()
532532

533-
page_data = model.pages.HtmlPage("Debug mode enabled confirmation",
533+
if allowed:
534+
django_request.session['developer_mode'] = True
535+
536+
page_data = model.pages.HtmlPage("Debug mode enabled result",
534537
pages.page_pieces.top_navigation(django_request),
535538
django_request=django_request)
536539
page_data.add_content("Confirmation",
537-
[T.p["Debug enabled for this session"]])
540+
[T.p["Debug enabled for this session."
541+
if allowed
542+
else "Debug not enabled for this session, as you are not an administrator."]])
538543

539544
return HttpResponse(str(page_data.to_string()))
540545

makers/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
SECRET_KEY = decouple.config('DJANGO_SECRET_KEY')
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
26-
DEBUG = True
26+
# DEBUG = True
27+
DEBUG = False
2728

2829
ALLOWED_HOSTS = ['fragaria', 'js64.twilightparadox.com', '127.0.0.1', '54.72.185.37', 'makers.makespace.org']
2930

0 commit comments

Comments
 (0)