Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25434 closed Bug (fixed)

Missing documentation for request.site attribute

Reported by: Nick Pope Owned by: Nick Pope
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When CurrentSiteMiddleware was added in 1.7, the documentation for the attribute HttpRequest.site was missed.

Change History (10)

comment:1 by Nick Pope, 9 years ago

As mentioned in the PR, this should also be backported to 1.7 and 1.8 with .. versionadded:: 1.7

comment:2 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

It seems a bit odd to me to document attributes that middleware set as "attributes of HttpRequest" but given we have request.user documented like that, I don't see a big reason not to document this other than request.user is far more common (enabled my default in new projects) than request.site. Maybe such attributes could be documented in a separate section (as a separate ticket) to make it more obvious.

FYI, we aren't making non-critical updates to the 1.7 docs since there's no workflow for allowing translating those updates, so we'll probably limit this to 1.8.

comment:3 by Nick Pope, 9 years ago

You've suggested exactly what I was thinking as an alternative - a separate section detailing the attributes that are added to the request by middleware. As well as request.user and request.site, there is also request.session which is set by middleware but currently doesn't mention the fact. I feel that it is useful to know where these attributes are meant to come from if they have not been set on the request object.

Would you rather that I just altered this ticket and the pull request instead of creating a separate ticket? One ticket along the lines of "separated docs for attributes set by middleware and added missing entries" seems sufficient.

comment:4 by Tim Graham, 9 years ago

Okay with me.

comment:5 by Tim Graham, 9 years ago

Patch needs improvement: set

comment:6 by Tim Graham, 9 years ago

Patch needs improvement: unset

comment:7 by Claude Paroz, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 02ef96c5:

Fixed #25434 -- Documented HttpRequest.site and created a section for middleware attributes.

Thanks Nick Pope for the initial patch.

comment:9 by Tim Graham <timograham@…>, 9 years ago

In 96c0ba3:

[1.9.x] Fixed #25434 -- Documented HttpRequest.site and created a section for middleware attributes.

Thanks Nick Pope for the initial patch.

Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master

comment:10 by Tim Graham <timograham@…>, 9 years ago

In 84ec3bf:

[1.8.x] Fixed #25434 -- Documented HttpRequest.site and created a section for middleware attributes.

Thanks Nick Pope for the initial patch.

Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master

Note: See TracTickets for help on using tickets.
Back to Top