[Django] #33687: Add option to set unusable password to changepassword

5 views
Skip to first unread message

Django

unread,
May 9, 2022, 2:52:29 AM5/9/22
to django-...@googlegroups.com
#33687: Add option to set unusable password to changepassword
------------------------------------------+------------------------
Reporter: Vlastimil Zíma | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
I just found out, there is no way to set unusable password for a user
using a command `changepassword`. It's sometimes needed to disable
password authentication, e.g. for robot accounts which use third party
authentication systems and similar cases. I suggest to add an option, e.g.
`--set-unusable-password` to the `changepassword` command which would
allow this.

--
Ticket URL: <https://code.djangoproject.com/ticket/33687>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 9, 2022, 3:28:26 AM5/9/22
to django-...@googlegroups.com
#33687: Add option to set unusable password to changepassword
--------------------------------+--------------------------------------

Reporter: Vlastimil Zíma | Owner: nobody
Type: New feature | Status: closed
Component: contrib.auth | Version: dev
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

Thanks for this ticket, however the `changepassword` command was never
intended to cover all available options. You can create a custom command
in your project or use a small standalone script instead:
{{{
UserModel = get_user_model()
user =
UserModel._default_manager.db_manager('default').get(username=username)
user.set_password(new_password)
user.set_unusable_password()
user.save()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33687#comment:1>

Reply all
Reply to author
Forward
0 new messages