Skip to content
Snippets Groups Projects
Commit d909f1e7 authored by Martin Mareš's avatar Martin Mareš
Browse files

Do not crash when trying to determine author roles in discussion topics

parent c7a8370f
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ def topic_post(form, student_uid) -> Optional[db.Post]:
if comment or attach or points is not None:
if g.is_teacher:
role = db.PostRole.teacher
elif g.uid == student_uid:
elif g.uid == student_uid or g.topic.type == 'D':
role = db.PostRole.student
elif g.is_grader:
role = db.PostRole.grader
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment