#36018: Sites.objects.get_current() will always return the settings.SITE_ID,
even
when the optional request is passed
-------------------------+-----------------------------------------
Reporter: devo-wm | Type: Bug
Status: new | Component: contrib.sites
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------+-----------------------------------------
It looks like if you've set the SITE_ID in your settings, the conditional
in get_current() will always return that site id, even if you pass the
optional request.
We thought that perhaps un-setting the SITE_ID would resolve this, but
these seems to counter the steps involved when enabling and configuring
the sites framework:
https://docs.djangoproject.com/en/5.1/ref/contrib/sites/#enabling-the-
sites-framework
The simple fix seems to be switching the order of the conditional in that
method, thereby always checking the optional request parameter first.
--
Ticket URL: <https://code.djangoproject.com/ticket/36018>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070193d124cd8b-d2a14ab0-d040-4f87-ba53-9dad7c21c499-000000%40eu-central-1.amazonses.com.