1. Hynek Cernoch
  2. django-livesettings

Commits

Craig de Stigter  committed 343a858 Draft

saner caching behaviour in find_setting

  • Participants
  • Parent commits 8aedf74
  • Branches default

Comments (0)

Files changed (1)

File livesettings/models.py

View file
  • Ignore whitespace
 
                 except Setting.DoesNotExist:
                     pass
-            
-                cache_set(ck, value=setting)
+                else:
+                    setting.cache_set()
 
     else:
         grp = overrides.get(group, None)
         self.value = value
         
     def cache_key(self, *args, **kwargs):
-        return cache_key('OverrideSetting', self.site, self.group, self.key)
+        return cache_key('OverrideSetting', self.site_id, self.group, self.key)
         
     def delete(self):
         pass
         return self.id is not None
 
     def cache_key(self, *args, **kwargs):
-        return cache_key('Setting', self.site, self.group, self.key)
+        return cache_key('Setting', self.site_id, self.group, self.key)
 
     def delete(self):
         self.cache_delete()