#31802: Validation for "SITE_ID" setting
-------------------------------+--------------------------------------
     Reporter:  Gagan Deep     |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  contrib.sites  |                  Version:  3.0
     Severity:  Normal         |               Resolution:
     Keywords:  sites, cache   |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Adam (Chainz) Johnson):

 Part of the problem here is that `Site.objects.get(pk=some_string)` works
 because the database uses [SQL implicit type
 conversion](https://adamj.eu/tech/2020/03/06/sql-implicit-type-
 conversion/) to cast the string, but we need a consistent value within
 Python.

 If it's only the site cache that's affected we could make `SITE_CACHE` a
 subclass of dict that casts keys but that seems like overengineering when
 a system check would provide enough validation at the boundary.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31802#comment:1>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/065.7e4f188e0a58f79c3f925e5e975bf7f9%40djangoproject.com.

Reply via email to