django-hijack-admin icon indicating copy to clipboard operation
django-hijack-admin copied to clipboard

Problem with a custom user model with a custom `USERNAME_FIELD`

Open John2013 opened this issue 5 years ago • 2 comments

I have custom user model with USERNAME_FIELD = 'email'

module requires User.username field which doesn't exist

please adapt the module for the custom user name field

John2013 avatar May 07 '19 15:05 John2013

i just stumbled on this issue as well. after some sourcecode digging i found the settings of this plugin. the relevant setting is HIJACK_REGISTER_ADMIN = False

after that change the plugin does not try to register a own usermodel with a username field. but you have to mixin HijackUserAdminMixin into your custom usermodel.

thelittlebug avatar May 19 '19 09:05 thelittlebug

but thats documented in the readme. maybe we just have to read a little bit better? :D

thelittlebug avatar May 19 '19 09:05 thelittlebug