SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 54c0a253 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add failsafe to fellowship role processing

parent 5167435e
No related branches found
No related tags found
No related merge requests found
...@@ -41,8 +41,9 @@ def roles_processor(request): ...@@ -41,8 +41,9 @@ def roles_processor(request):
) )
except active_fellowships.model.DoesNotExist: except active_fellowships.model.DoesNotExist:
context["session_fellowship"] = active_fellowships.first() context["session_fellowship"] = active_fellowships.first()
if context["session_fellowship"].senior: if "session_fellowship" in context:
context["user_roles"].append("active_senior_fellow") if getattr(context["session_fellowship"], "senior"):
context["user_roles"].append("active_senior_fellow")
except AttributeError: except AttributeError:
pass pass
return context return context
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment