#24789 closed Bug (fixed)
Minor error in Customizing authentication in Django / Referencing the User model
Reported by: | Charles Dee Rice | Owned by: | Charles Dee Rice |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
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!
Change History (6)
follow-up: 2 comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Replying to 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.
comment:3 by , 9 years ago
Ok, assuming I crossed the appropriate t's and dotted the i's:
Commit:
https://github.com/django/django/commit/afe637250a950fbdb91e7c77cad54a65d7bf13ea
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!