[Django] #20673: Improve HttpRequest.user documentation

26 views
Skip to first unread message

Django

unread,
Jun 28, 2013, 3:24:00 AM6/28/13
to django-...@googlegroups.com
#20673: Improve HttpRequest.user documentation
--------------------------------------+--------------------
Reporter: littlepig | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.5
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
In [https://docs.djangoproject.com/en/dev/ref/request-
response/#django.http.HttpRequest.user] it is said

{{{
A django.contrib.auth.models.User object representing the currently
logged-in user.
}}}

But apparently ([http://stackoverflow.com/questions/17355275]), it returns
the AUTH_USER_MODEL if it is defined.

I think this should be clarified in the documentation.

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

Django

unread,
Jun 28, 2013, 4:22:11 AM6/28/13
to django-...@googlegroups.com
#20673: Improve HttpRequest.user documentation
--------------------------------------+------------------------------------

Reporter: littlepig | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.5
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
* needs_docs: => 0
* needs_tests: => 0
* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Good catch, thanks.

It looks like the docstring for `contrib.auth.backends.ModelBackend` [1]
is incorrect too.

[1]
https://github.com/django/django/blob/master/django/contrib/auth/backends.py#L8

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

Django

unread,
Jun 29, 2013, 4:48:32 AM6/29/13
to django-...@googlegroups.com
#20673: Improve HttpRequest.user documentation
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.5

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

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


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

Django

unread,
Jun 29, 2013, 7:23:04 PM6/29/13
to django-...@googlegroups.com
#20673: Improve HttpRequest.user documentation
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.5

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

To be honest, I'm not entirely sure what the docstring needs to be in
"contrib.auth.backends.ModelBackend". Can someone point me in the right
direction?

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

Django

unread,
Jun 30, 2013, 9:15:19 PM6/30/13
to django-...@googlegroups.com
#20673: Improve HttpRequest.user documentation
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.5

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

Feel free to check this 1-line change:
https://github.com/onceuponatimeforever/django/commit/177f0400c46d27463316c962780ea4b351077aeb

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

Django

unread,
Jul 2, 2013, 3:52:28 PM7/2/13
to django-...@googlegroups.com
#20673: Clarify that HttpRequest.user uses AUTH_USER_MODEL

--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.5

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

Susan, the problem is that the docs say that a
`django.contrib.auth.models.User` object is returned, but with the
introduction of custom user models, that may no longer be true.

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

Django

unread,
Jul 3, 2013, 4:19:33 PM7/3/13
to django-...@googlegroups.com
#20673: Clarify that HttpRequest.user uses AUTH_USER_MODEL
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.5

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 Chandrakant Gopalan):

Let me take a shot...

Instead of:

A ``django.contrib.auth.models.User`` object representing the
currently
logged-in user.

Say this:

An object representing the currently logged-in user. Will be the user
object in
:setting:`AUTH_USER_MODEL` setting if specified,
``django.contrib.auth.models.User`` otherwise.

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

Django

unread,
Jul 4, 2013, 9:33:40 AM7/4/13
to django-...@googlegroups.com
#20673: Clarify that HttpRequest.user uses AUTH_USER_MODEL
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.5
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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"f407f75aae242d1bd8d4ac7f19c5d4075353c65e"]:
{{{
#!CommitTicketReference repository=""
revision="f407f75aae242d1bd8d4ac7f19c5d4075353c65e"
Fixed #20673 -- Clarified that HttpRequest.user uses AUTH_USER_MODEL.

Thanks littlepig for the report.
}}}

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

Django

unread,
Jul 4, 2013, 9:34:23 AM7/4/13
to django-...@googlegroups.com
#20673: Clarify that HttpRequest.user uses AUTH_USER_MODEL
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.5

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 Tim Graham <timograham@…>):

In [changeset:"82a6a956d50edf1008b89b886090459d2e65ac1a"]:
{{{
#!CommitTicketReference repository=""
revision="82a6a956d50edf1008b89b886090459d2e65ac1a"
[1.5.x] Fixed #20673 -- Clarified that HttpRequest.user uses
AUTH_USER_MODEL.

Thanks littlepig for the report.

Backport of f407f75aae from master.
}}}

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

Django

unread,
Jul 4, 2013, 9:34:28 AM7/4/13
to django-...@googlegroups.com
#20673: Clarify that HttpRequest.user uses AUTH_USER_MODEL
--------------------------------------+------------------------------------
Reporter: littlepig | Owner: susan
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.5

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 Tim Graham <timograham@…>):

In [changeset:"23748c483b128773edb5f5e8ee509bf12732595c"]:
{{{
#!CommitTicketReference repository=""
revision="23748c483b128773edb5f5e8ee509bf12732595c"
[1.6.x] Fixed #20673 -- Clarified that HttpRequest.user uses
AUTH_USER_MODEL.

Thanks littlepig for the report.

Backport of f407f75aae from master.
}}}

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

Reply all
Reply to author
Forward
0 new messages