Skip to content
Snippets Groups Projects
Commit 2a7bd15e authored by jan.bednarik's avatar jan.bednarik
Browse files

Fix editing drafts for users who are not authors yet.

parent e49382d6
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ def pythonize_report(report):
report['date'] = arrow.get(report['date']).to(settings.TIME_ZONE).date()
if 'published' in report:
report['published'] = arrow.get(report['published']).to(settings.TIME_ZONE).datetime
if 'author' in report:
if 'author' in report and report['author'] is not None:
report['author'] = pythonize_author(report['author'])
return report
......
......@@ -305,6 +305,7 @@ class EditReportView(FormView):
id = self.kwargs['id']
report, viewer = queries.get_report(settings.OPENLOBBY_API_URL, id, token=token)
if not report['isDraft']:
if report['author']['id'] != viewer['id']:
raise Http404
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment