user956424
user956424

Reputation: 1609

Display user group of logged in user in django admin change_form.html?

How to display user group of logged in user in django admin change_form.html ? I want to display the group name of the logged in user in the change_form of a model. Eg I am able to display the user name by using {{ user }} tag. How to display {{ user.groups__name }}

Upvotes: 1

Views: 1233

Answers (1)

T I
T I

Reputation: 9943

Not sure if you can do it directly in the template though you can try iterating over user.groups.all()

Upvotes: 2

Related Questions