Corvia / django-tenant-users

Adds global user authentication and tenant-specific permissions to django-tenants.
https://django-tenant-users.rtfd.io
MIT License
334 stars 64 forks source link

Create/modify a tenant user in django-admin page #525

Closed stonefullstm closed 1 week ago

stonefullstm commented 8 months ago

When AUTH_USER_MODEL is a custom model, features are lost in admin panel and I am not able create users or modify passwords using admin page as the passwords are not hashed. Does anyone suggest something?

Dresdn commented 8 months ago

You'll need to register your user model with the admin site.

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-django-contrib-admin

You will also need to register your custom user model with the admin.
...
However, if your user model extends AbstractBaseUser, you’ll need to define a custom ModelAdmin class.

Since we inherit from AbstractBaseUser, you'll need to take that into account.

This would be a great documentation add as we don't have anything around this!

stonefullstm commented 8 months ago

Thank you very much for the guidance