#26745: Add the possibilty to extend the createsuper user command
------------------------------+--------------------------------------
Reporter: Lyra2108 | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+--------------------------------------
Comment (by apollo13):
I am not particularly fond of either solution.
* Signal registration is global and would happen for every user not just
the superuser
* A custom manager seems overkill if all you want is to add some data
somewhere and do not have your own user model
* Overriding the command is still work but probably the best solution
suggested
Another option: Stuff something onto AppConfig and make create_superuser
use
`apps.get_app_config(get_user_model()._meta.app_label).create_superuser`
which by default just be (ie if not defined):
```
UserModel._default_manager.db_manager(database).create_superuser(**user_data)
```
I think pre/post are overkill, someone customizing that can as well just
write the create_superuser line too.
--
Ticket URL: <https://code.djangoproject.com/ticket/26745#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.1a620f4c80f4c6ecf99e30e0e43b72bb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.