Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #35401 -- Documented the conditional page decorator. #18150

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

lufafajoshua
Copy link
Contributor

Mentioned the use of the conditional page decorator to provide functionality for Conditional for
ConditionalGetMiddleware on individual views, also mentioned the use of csrf_protect decorator to add protection of CsrfViewMiddleware to a view.

Trac ticket number

ticket-35401

Branch description

Provide a concise overview of the issue or rationale behind the proposed changes.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lufafajoshua ⭐ I have some small comments

docs/ref/middleware.txt Outdated Show resolved Hide resolved
@@ -71,6 +71,11 @@ a :class:`django.http.HttpResponseNotAllowed` if the conditions are not met.

Support for wrapping asynchronous view functions was added.

.. function:: conditional_page()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be defined in the Conditional view processing section below rather than this section.
There is also a Conditional View Processing topic docs/topics/conditional-view-processing.txt, I'm wondering if this should be described over there too 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sarahboyce , I was thinking a link to Conditional GET middleware in Comparing conditional processing would be enough to guide someone to the conditional page decorator.

@sarahboyce sarahboyce force-pushed the ticket_35401 branch 2 times, most recently from ae547d6 to 44055e0 Compare June 12, 2024 10:31
Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @lufafajoshua

@sarahboyce sarahboyce merged commit e242829 into django:main Jun 12, 2024
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants