mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-18 02:54:55 -06:00
10 lines
369 B
Python
10 lines
369 B
Python
def user_projects_processor(request):
|
|
if not hasattr(request, "user"):
|
|
# check, because if there's a failure "very early" in the request handling, we don't have an AnonymousUser
|
|
return {"user_projects": []}
|
|
|
|
if not request.user.is_authenticated:
|
|
return {'user_projects': []}
|
|
|
|
return {'user_projects': request.user.project_set.all()}
|