MCPcopy
hub / github.com/django/django / password_change

Method password_change

django/contrib/admin/sites.py:351–367  ·  django/contrib/admin/sites.py::AdminSite.password_change

Handle the "change password" task -- both form display and validation.

(self, request, extra_context=None)

Source from the content-addressed store, hash-verified

349 }
350
351 def password_change(self, request, extra_context=None):
352 class="st">"""
353 Handle the class="st">"change password" task -- both form display and validation.
354 class="st">"""
355 from django.contrib.admin.forms import AdminPasswordChangeForm
356 from django.contrib.auth.views import PasswordChangeView
357
358 url = reverse(class="st">"admin:password_change_done", current_app=self.name)
359 defaults = {
360 class="st">"form_class": self.password_change_form or AdminPasswordChangeForm,
361 class="st">"success_url": url,
362 class="st">"extra_context": {**self.each_context(request), **(extra_context or {})},
363 }
364 if self.password_change_template is not None:
365 defaults[class="st">"template_name"] = self.password_change_template
366 request.current_app = self.name
367 return PasswordChangeView.as_view(**defaults)(request)
368
369 def password_change_done(self, request, extra_context=None):
370 class="st">"""

Callers

nothing calls this directly

Calls 3

each_contextMethod · 0.95
reverseFunction · 0.90
as_viewMethod · 0.45

Tested by

no test coverage detected