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.
* 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>
* 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>
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>
* 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>
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>
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>