Bugfix change CustomUser's manager to enable migration making#451
Bugfix change CustomUser's manager to enable migration making#451
Conversation
| operations = [ | ||
| migrations.AlterModelManagers( | ||
| name='customuser', | ||
| managers=[ |
There was a problem hiding this comment.
I guess it's okay, since the manager is now created dynamically?
There was a problem hiding this comment.
Looks like thanks to this CustomUser managers will no longer be tracked in migrations, so it should be ok.
|
|
||
|
|
||
| class CustomUserManager(BaseUserManager): | ||
| use_in_migrations = True |
There was a problem hiding this comment.
The usage of this property is obscure. According to Django documentation it has to do with serialisation. @Szymiks reported seeing this on forums regarding REST framework. This line was created by @MartynaAnnaGottschling back in October 2018. full-check did not raise any errors after it got removed.
Is it therefore safe to assume that this is a leftover from the REST implementation and can be safely deleted?
There was a problem hiding this comment.
Not related with REST exactly, but with possibility to use custom manager methods in migrations. As we don't use them, lets remove it.
dybi
left a comment
There was a problem hiding this comment.
LGTM, but please wait till @rwrzesien gives his insights ;)
No issue for this.
Fixes an issue where
makemigrationscall fails with an error, related to CustomUsers's manager class not being found.