It currently says:
...
# Create a new user. Note that we can set password
# to anything, because it won't be checked; the password
# from settings.py will.
user = User(username=username, password='get from
settings.py')
....
A better practice would be to call "set_unusable_password()" on the user
object.
--
Ticket URL: <https://code.djangoproject.com/ticket/27292>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Could you explain that a bit more? It looks to me like `password='get from
settings.py'` could be `password=settings.ADMIN_PASSWORD`, but I don't
understand why setting an unusable password would be desired.
--
Ticket URL: <https://code.djangoproject.com/ticket/27292#comment:1>
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Proposed patch is attached. Let me know if I missed the reason why
`set_unusable_password()` is useful.
--
Ticket URL: <https://code.djangoproject.com/ticket/27292#comment:2>
* Attachment "27292.diff" added.
Comment (by Tim Graham <timograham@…>):
In [changeset:"7652f97a5c5af3ed4b5d306e7a7d4db9df93ecf5" 7652f97]:
{{{
#!CommitTicketReference repository=""
revision="7652f97a5c5af3ed4b5d306e7a7d4db9df93ecf5"
[1.10.x] Fixed #27292 -- Removed unnecessary password assignment in auth
backend example.
Backport of e262f002311735869a5d8b0a8f788708322db595 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27292#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"e262f002311735869a5d8b0a8f788708322db595" e262f002]:
{{{
#!CommitTicketReference repository=""
revision="e262f002311735869a5d8b0a8f788708322db595"
Fixed #27292 -- Removed unnecessary password assignment in auth backend
example.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27292#comment:3>