Commit a8ba0e45 authored by Thom Wiggers's avatar Thom Wiggers

Merge branch 'fix/more-fixes' into 'master'

Fixes in calendar view and exam downloading

Closes #898

See merge request !1312
parents dbbc6a20 71d7344f
[tool.poetry]
name = "concrexit"
version = "24.0.0"
version = "25.3.0"
description = "New new Thalia website, now with extra Django."
authors = ["Thalia Technicie <www@thalia.nu>"]
license = "AGPL-3.0-or-later"
......
......@@ -23,7 +23,7 @@ urlpatterns = [
name="submit-summary"),
path('', CourseDetailView.as_view(), name="course"),
])),
path('exam/<int:pk>/', ExamDetailView.as_view, name="exam"),
path('exam/<int:pk>/', ExamDetailView.as_view(), name="exam"),
path('summary/(<int:pk>/', SummaryDetailView.as_view(),
name="summary"),
path('exam/upload/', ExamCreateView.as_view(),
......
......@@ -38,7 +38,8 @@ class ListView extends FullCalendar.View {
month: 'long',
weekday: 'long',
year: 'numeric',
hour12: false,
timeZone: 'UTC',
hour12: locale !== 'nl',
});
const eventCard = document.createElement('div');
......
......@@ -66,26 +66,24 @@ def _extract_date(param):
def extract_date_range(request, allow_empty=False):
"""Extract a date range from an arbitrary string"""
default_value = ''
if allow_empty:
default_value = None
default_value = None
start = request.query_params.get('start', default_value)
if start:
start = dateparse.parse_datetime(start)
if not timezone.is_aware(start):
start = timezone.make_aware(start)
if not start and not allow_empty:
raise ParseError(detail='start query parameter invalid')
if start or not allow_empty:
try:
start = dateparse.parse_datetime(start)
if not timezone.is_aware(start):
start = timezone.make_aware(start)
except (ValueError, AttributeError, TypeError) as e:
raise ParseError(detail='start query parameter invalid') from e
end = request.query_params.get('end', default_value)
if end:
end = dateparse.parse_datetime(end)
if not timezone.is_aware(end):
end = timezone.make_aware(end)
if not end and not allow_empty:
raise ParseError(detail='end query parameter invalid')
if end or not allow_empty:
try:
end = dateparse.parse_datetime(end)
if not timezone.is_aware(end):
end = timezone.make_aware(end)
except (ValueError, AttributeError, TypeError) as e:
raise ParseError(detail='end query parameter invalid') from e
return start, end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment