-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Pass request to Site.objects.get_current #8298
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideExtended get_current_site to require an HttpRequest argument (with a deprecation warning when omitted), added a return type annotation for get_language_from_request, and refactored all callers (admin, toolbar, decorators, i18n, page utilities, views, wizards, and menus) to pass the request object. Sequence diagram for get_current_site usage with request parametersequenceDiagram
participant Caller
participant get_current_site
participant SiteManager as Site.objects
Caller->>get_current_site: get_current_site(request)
get_current_site->>SiteManager: get_current(request)
SiteManager-->>get_current_site: Site instance
get_current_site-->>Caller: Site instance
Class diagram for updated get_current_site utility functionclassDiagram
class get_current_site {
+Site get_current_site(request: Optional[HttpRequest])
}
class Site {
+Site get_current(request: Optional[HttpRequest])
}
get_current_site --> Site : calls get_current(request)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8298 +/- ##
=======================================
Coverage 89.57% 89.57%
=======================================
Files 129 129
Lines 12691 12694 +3
=======================================
+ Hits 11368 11371 +3
Misses 1323 1323 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Related resources
Checklist
main
Summary by Sourcery
Forward request context to site resolution for consistent behavior and deprecate implicit usage
Enhancements: