[Django] #24789: Minor error in Customizing authentication in Django / Referencing the User model

4 views
Skip to first unread message

Django

unread,
May 12, 2015, 6:21:10 AM5/12/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+--------------------
Reporter: cdrice | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
The example code under:
[https://docs.djangoproject.com/en/1.8/topics/auth/customizing
/#referencing-the-user-model]

defines and registers a method:

{{{
def post_save_receiver(signal, sender, instance, **kwargs):
pass

post_save.connect(post_save_receiver, sender=settings.AUTH_USER_MODEL)
}}}

However, these (signal, sender, instance) appear to be the incorrect
positional arguments for a post_save signal (which might start as: sender,
instance, created), as documented:
[https://docs.djangoproject.com/en/1.8/ref/signals/#post-save]

I believe a corrected version of the example code would read:

{{{
def post_save_receiver(sender, instance, created, **kwargs):
pass

post_save.connect(post_save_receiver, sender=settings.AUTH_USER_MODEL)
}}}

A cursory review of the document versions shows this was introduced to the
documentation in 1.7 and is also present in 1.8 and Dev.


This is my first bug report; please forgive me and point me in the right
direction if I have completed any fields or information incorrectly.

Thank you!

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

Django

unread,
May 12, 2015, 6:28:35 AM5/12/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------

Reporter: cdrice | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.7
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 bmispelon):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

Hi,

I believe you're absolutely correct and this is exactly the right place
and way to report such an issue.

If you'd like to try your hand at it, you could try to submit a pull
request for this (the file to edit is at
https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L453).


Thanks!

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

Django

unread,
May 12, 2015, 8:44:22 PM5/12/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------
Reporter: cdrice | Owner: cdrice
Type: Bug | Status: assigned
Component: Documentation | Version: 1.7

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 cdrice):

* status: new => assigned
* owner: nobody => cdrice


Comment:

Replying to [comment:1 bmispelon]:


> If you'd like to try your hand at it, you could try to submit a pull
request for this (the file to edit is at
https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L453).

Thank you, sir!

I would be happy and honored to do so. I was going to look into this
process myself later today; your comment and link made it even easier!

Claiming ticket now -- wish me luck.

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

Django

unread,
May 12, 2015, 9:26:41 PM5/12/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------
Reporter: cdrice | Owner: cdrice
Type: Bug | Status: assigned
Component: Documentation | Version: 1.7

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
-------------------------------+------------------------------------

Comment (by cdrice):

Ok, assuming I crossed the appropriate t's and dotted the i's:

Commit:
https://github.com/django/django/commit/afe637250a950fbdb91e7c77cad54a65d7bf13ea

Pull:
https://github.com/django/django/pull/4647

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

Django

unread,
May 13, 2015, 4:15:35 AM5/13/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------
Reporter: cdrice | Owner: cdrice
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

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 Baptiste Mispelon <bmispelon@…>):

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


Comment:

In [changeset:"4f3c44424187de20d7f75fdde6624b9f683a9cf2" 4f3c4442]:
{{{
#!CommitTicketReference repository=""
revision="4f3c44424187de20d7f75fdde6624b9f683a9cf2"
Fixed #24789 -- Fixed wrong positional args order in doc example

Arguments shown in example code (signal, sender, instance) appeared to


be the incorrect positional arguments for a post_save signal (which
might start as: sender, instance, created), as documented:
https://docs.djangoproject.com/en/1.8/ref/signals/#post-save
}}}

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

Django

unread,
May 13, 2015, 4:31:08 AM5/13/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------
Reporter: cdrice | Owner: cdrice
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"5dee28030c7485a6fc3f40255100413938709598" 5dee2803]:
{{{
#!CommitTicketReference repository=""
revision="5dee28030c7485a6fc3f40255100413938709598"
[1.7.x] Fixed #24789 -- Fixed wrong positional args order in doc example

Arguments shown in example code (signal, sender, instance) appeared to


be the incorrect positional arguments for a post_save signal (which
might start as: sender, instance, created), as documented:
https://docs.djangoproject.com/en/1.8/ref/signals/#post-save

Backport of 4f3c44424187de20d7f75fdde6624b9f683a9cf2 from master.
}}}

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

Django

unread,
May 13, 2015, 4:31:11 AM5/13/15
to django-...@googlegroups.com
#24789: Minor error in Customizing authentication in Django / Referencing the User
model
-------------------------------+------------------------------------
Reporter: cdrice | Owner: cdrice
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"e4fa298e30094969760a5b9b6a6ccdfd54d23559" e4fa298]:
{{{
#!CommitTicketReference repository=""
revision="e4fa298e30094969760a5b9b6a6ccdfd54d23559"
[1.8.x] Fixed #24789 -- Fixed wrong positional args order in doc example

Arguments shown in example code (signal, sender, instance) appeared to


be the incorrect positional arguments for a post_save signal (which
might start as: sender, instance, created), as documented:
https://docs.djangoproject.com/en/1.8/ref/signals/#post-save

Backport of 4f3c44424187de20d7f75fdde6624b9f683a9cf2 from master.
}}}

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

Reply all
Reply to author
Forward
0 new messages