Handle the "change password" task -- both form display and validation.
(self, request, extra_context=None)
| 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">""" |
nothing calls this directly
no test coverage detected