Answer the question
In order to leave comments, you need to log in
Why doesn't request.user.is_superuser work in Django?
I'm still learning Django. When I make a condition (for example: if self.request.user.is_superuser: ) then I immediately get an Error 500 error.
I work in the admin panel!
from django.contrib.auth.models import User - enabled
PS - please do not scold me, still a beginner)
Answer the question
In order to leave comments, you need to log in
In BookAdmin:
list_display = ('fio_klient', 'adres')
def get_list_display(self, request):
if request.user.is_superuser:
return self.list_display + ('status',)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question