fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/shelfzilla/apps/users/context_processors.py

23 lines
403 B
Python

from .models import User
def user_is_staff(request):
return {
'USER_IS_STAFF': request.user.is_staff
}
def user_configuration(request):
return {
'USER_CONFIG': {
'show_admin_links': False
}
}
def auth(request):
result = {}
if request.user.is_authenticated:
result['user'] = User.objects.get(pk=request.user.pk)
return result