Commits

Anonymous committed 343a858 Draft

saner caching behaviour in find_setting

Comments (0)

Files changed (1)

livesettings/models.py

 
                 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()