#31593: Replace hardcoded path to PasswordChangeView in UserChangeForm with
reverse
of its URL
-------------------------------------+-------------------------------------
Reporter: Denis | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Forms | Version: 3.0
Severity: Normal | Keywords: user, password,
Triage Stage: | form, UserChangeForm
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm using built-in forms for authentication.
Created {{{CustomUser}}} with
[https://docs.djangoproject.com/en/3.0/topics/auth/customizing/#custom-
users-and-the-built-in-auth-forms CustomUserCreationForm] and
CustomUserChangeForm.
CustomUserChangeForm is based on
[https://github.com/django/django/blob/stable/3.0.x/django/contrib/auth/forms.py#L141
UserChangeForm].
If password is get successfully {{{help_text}}} is supplied with
{{{'../password/'}}} path:
{{{
help_text=_(...but you can change the password using <a href="{}">this
form</a>.),
***
if password:
password.help_text = password.help_text.format('../password/')
}}}
But aimed form has {{{password_change}}} URL in
[https://github.com/django/django/blob/stable/3.0.x/django/contrib/auth/urls.py#L13
auth/urls.py]:
{{{
path('password_change/', views.PasswordChangeView.as_view(),
name='password_change'),
}}}
And there is no easy way to substitute it (I mean it's a hardcoded string)
--
Ticket URL: <https://code.djangoproject.com/ticket/31593>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.f7b5b61aeb8f41c33f60d539a09277a7%40djangoproject.com.