python - django user group from request user -
i have assigned user group developer
, in admin want query like:
user_group = request.user.groups
its giving me auth.group.none
though have assigned user in group.
why getting none while have assigned user group
as matth pointed out here https://stackoverflow.com/a/2245908/5936450 use following (slightly altered example):
user_group = request.user.groups.values_list('name', flat=true)
Comments
Post a Comment