diff --git a/scipost_django/scipost/context_processors.py b/scipost_django/scipost/context_processors.py index 71c8add38370b8172fc09901e05e20a715616661..65bc957b8080b99592df1fc0f113753a1ae6d7a3 100644 --- a/scipost_django/scipost/context_processors.py +++ b/scipost_django/scipost/context_processors.py @@ -41,8 +41,9 @@ def roles_processor(request): ) except active_fellowships.model.DoesNotExist: context["session_fellowship"] = active_fellowships.first() - if context["session_fellowship"].senior: - context["user_roles"].append("active_senior_fellow") + if "session_fellowship" in context: + if getattr(context["session_fellowship"], "senior"): + context["user_roles"].append("active_senior_fellow") except AttributeError: pass return context