I'll dig at that; thanks.
I've just managed to get one of my Google accounts into this "broken" state, although I'm not entirely sure how I did it (or where the broken state is stored).
This happened after I tried using the "Sign In" button on a list info page rather than the one in the upper right corner, but that may just be a red herring.
I'll report back if I find anything.
--Jered
----- On Dec 6, 2023, at 3:21 PM, Mark Sapiro mark@msapiro.net wrote:
On 12/6/23 11:00, Jered Floyd wrote:
These errors are generated to me as the admin, and in the elided environment section SITE_ID is indeed 0, but I'm at a loss to imagine why this happens only sometimes!
For me, on a test installation with SITE_ID = 0, this only occurs at https://example.com/accounts/social/connections/
Other URLs such as https://example.com/accounts/password/change/ and https://example.com/accounts/email/ do not throw this exception.
Here's the code:
def get_current(self, request=None): """ Return the current Site based on the SITE_ID in the project's settings. If SITE_ID isn't defined, return the site with domain matching request.get_host(). The ``Site`` object is cached the first time it's retrieved from the database. """ from django.conf import settings if getattr(settings, "SITE_ID", ""): site_id = settings.SITE_ID return self._get_site_by_id(site_id) elif request: return self._get_site_by_request(request) raise ImproperlyConfigured( 'You\'re using the Django "sites framework" without having ' "set the SITE_ID setting. Create a site in your database and " "set the SITE_ID setting or pass a request to " "Site.objects.get_current() to fix this error." )
I tried patching it from
if getattr(settings, "SITE_ID", ""):
to
if getattr(settings, "SITE_ID", None) is not None:
but that's even worse. It throws a bunch of "django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist." errors.
Somehow, get_current is being called without a request object in the cases where it fails.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to jered@convivian.com