[Django] #24944: Have password_reset pass extra_context to the email template rendering as well

41 views
Skip to first unread message

Django

unread,
Jun 6, 2015, 2:08:56 PM6/6/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
-------------------------------+--------------------
Reporter: twelveeighty | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
The password_reset function in auth.views currently allows for extra
context parameters to be passed to the rendered reset password form, but
it does not pass through those extra context parameters to the 'opt'
dictionary used for the email template. This should be an easy feature to
add: just before the form.save(), add the extra_context to the opts
dictionary:

{{{
# inside the request.method == 'POST' and form.isValid() block:
opts = { ... }
if extra_context is not None:
opts.update(extra_context)
form.save(**opts)
}}}

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

Django

unread,
Jun 9, 2015, 6:31:51 PM6/9/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+------------------------------------

Reporter: twelveeighty | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* component: Uncategorized => contrib.auth
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 1 => 0
* stage: Unreviewed => Accepted


Comment:

I guess it's unlikely, but we'd have a small backwards compatibility issue
if someone is using `extra_context` with a key that clashes with one in
`opts`. For that reason, it might be better to use a separate parameter.

There is also the idea of converting these views to class-based views in
#17209 which might help here.

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

Django

unread,
Jun 18, 2015, 6:51:45 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned

Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* status: new => assigned
* cc: sujay.skumar141295@… (added)
* owner: nobody => SujaySKumar


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:2>

Django

unread,
Jun 18, 2015, 8:21:49 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: closed
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* status: assigned => closed
* needs_docs: 0 => 1
* has_patch: 0 => 1
* resolution: => fixed
* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:3>

Django

unread,
Jun 18, 2015, 9:00:37 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: new
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by timgraham):

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


Comment:

A ticket isn't marked fixed until the patch is committed to Django. Also
your patch is missing tests and documentation as outlined in our
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#patch-review-checklist patch review checklist]. Also
your patch has a problem if someone is using `extra_context` with a key
that clashes with one in `opts` as I mentioned in comment 1.

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:4>

Django

unread,
Jun 18, 2015, 9:05:28 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: new
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:5>

Django

unread,
Jun 18, 2015, 9:15:34 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: new
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------

Comment (by SujaySKumar):

Replying to [comment:4 timgraham]:


> A ticket isn't marked fixed until the patch is committed to Django. Also
your patch is missing tests and documentation as outlined in our
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#patch-review-checklist patch review checklist]. Also
your patch has a problem if someone is using `extra_context` with a key
that clashes with one in `opts` as I mentioned in comment 1.

I am new to contributing to open source. I am not able to understand where
to put the documentation for this new feature. I would be grateful if you
could point to the file in which I should add the documentation.

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:6>

Django

unread,
Jun 18, 2015, 9:18:14 AM6/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: new
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------

Comment (by timgraham):

The password reset function is documented in
`docs/topics/auth/default.txt`.

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:7>

Django

unread,
Jun 22, 2015, 3:25:53 AM6/22/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned

Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:8>

Django

unread,
Jun 22, 2015, 3:58:23 AM6/22/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:9>

Django

unread,
Sep 13, 2015, 2:35:48 AM9/13/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:10>

Django

unread,
Sep 13, 2015, 2:47:21 AM9/13/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:11>

Django

unread,
Sep 15, 2015, 1:59:16 PM9/15/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by berkerpeksag):

* needs_better_patch: 0 => 1


Comment:

Left some trivial review comments. Tim also reviewed the pull request
yesterday.

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:12>

Django

unread,
Sep 17, 2015, 9:13:36 AM9/17/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: assigned
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by SujaySKumar):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:13>

Django

unread,
Sep 18, 2015, 7:02:39 PM9/18/15
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+---------------------------------------
Reporter: twelveeighty | Owner: SujaySKumar
Type: New feature | Status: closed
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed

* resolution: => fixed


Comment:

In [changeset:"d8d853378b3ff75c03d8bd91ea026d2b8c642b0f" d8d85337]:
{{{
#!CommitTicketReference repository=""
revision="d8d853378b3ff75c03d8bd91ea026d2b8c642b0f"
Fixed #24944 -- Added extra_email_context parameter to password_reset()
view.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:14>

Django

unread,
May 27, 2019, 6:27:01 AM5/27/19
to django-...@googlegroups.com
#24944: Have password_reset pass extra_context to the email template rendering as
well
------------------------------+-----------------------------------------
Reporter: twelveeighty | Owner: Sujay S Kumar

Type: New feature | Status: closed
Component: contrib.auth | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+-----------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"aff61790a326f214f5ea608bac8298c3a8716b1b" aff61790]:
{{{
#!CommitTicketReference repository=""
revision="aff61790a326f214f5ea608bac8298c3a8716b1b"
Refs #24944 -- Added test for overriding domain in email context in
PasswordResetView.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24944#comment:15>

Reply all
Reply to author
Forward
0 new messages