Frage

I'm creating an admin interface for a customer (separate from the supplied Django admin interface), and I need a way to change a user's superuser/staff status.

I can fetch the User object for a specified user, but I don't know how to change the superuser/staff status for that User.

Not surprisingly, doing

user.is_superuser = False

didn't work.

War es hilfreich?

Lösung

See Scott Woodall's comment above. I forgot to do:

user.save()

which commits the changes.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top