#35141: CACHE_MIDDLEWARE_SECONDS can be set to a float but has to be an int
     Reporter:  Alexander Lazarević  |                    Owner:  Alexander
         Type:                       |  Lazarević
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
Comment (by Alexander Lazarević):

 > I'm not sure we want to go down the path of casting every integer

 Maybe this could be part of the system checks? Here as an example only for
 one setting, but could be extended to more settings as well.

 def check_settings_types(app_configs, **kwargs):
     setting = getattr(settings, "CACHE_MIDDLEWARE_SECONDS", None)
     if setting and not isinstance(setting, int):
         return [
                 "The CACHE_MIDDLEWARE_SECONDS setting should be an
     return []
Ticket URL: <https://code.djangoproject.com/ticket/35141#comment:12>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to