Commit 49db34a2 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'fix/allow-event-detail-in-past' into 'master'

Allow event detail viewing in the API

Closes ThaliApp#62

See merge request !826
parents 079eaaab 98535a37
...@@ -51,6 +51,9 @@ class EventViewset(viewsets.ReadOnlyModelViewSet): ...@@ -51,6 +51,9 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
def get_queryset(self): def get_queryset(self):
queryset = Event.objects.filter(published=True) queryset = Event.objects.filter(published=True)
if self.action == 'retrieve':
return queryset
try: try:
start = _extract_date(self.request.query_params.get('start', None)) start = _extract_date(self.request.query_params.get('start', None))
except (ValueError, InvalidTimeError) as e: except (ValueError, InvalidTimeError) as e:
......
Supports Markdown
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