From 7090ef7872b43bc05c998969231b340d1de61d92 Mon Sep 17 00:00:00 2001 From: Tom Teichler <tom.teichler@teckids.org> Date: Sun, 3 Nov 2019 09:21:59 +0100 Subject: [PATCH] Allow superusers to create lesson documentations in the future. --- biscuit/apps/alsijil/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biscuit/apps/alsijil/views.py b/biscuit/apps/alsijil/views.py index f31b14af1..ce4694ff6 100644 --- a/biscuit/apps/alsijil/views.py +++ b/biscuit/apps/alsijil/views.py @@ -35,7 +35,7 @@ def lesson(request: HttpRequest, year: Optional[int] = None, week: Optional[int] else: raise Http404(_('You either selected an invalid lesson or there is currently no lesson in progress.')) - if datetime.combine(wanted_week[lesson_period.period.weekday - 1], lesson_period.period.time_start) > datetime.now(): + if datetime.combine(wanted_week[lesson_period.period.weekday - 1], lesson_period.period.time_start) > datetime.now() and not request.user.is_superuser: raise PermissionDenied(_('You are not allowed to create a lesson documentation for a lesson in the future.')) context['lesson_period'] = lesson_period -- GitLab