1👍
✅
self.request.user.groups
prints always None
: that is a RelatedManager
[Django-doc], not a QuerySet
. Managers will print the model name with None
, so for a Model
named ModelName
in app_name
, it prints:
app_name.ModelName.None
You print the items with self.request.user.groups.all()
:
print(self.request.user.groups.all())
Source:stackexchange.com