Force cache invalidation when Raw Setting is edited

only applies if caching is actually in use
This commit is contained in:
Lance Edgar 2022-08-03 15:15:49 -05:00
parent 4ff0450632
commit 927470db72

View file

@ -80,6 +80,12 @@ class SettingView(MasterView):
return not bool(self.feedback.match(setting.name)) return not bool(self.feedback.match(setting.name))
return True return True
def after_edit(self, setting):
# nb. force cache invalidation - normally this happens when a
# setting is saved via app handler, but here that is being
# bypassed and it is saved directly via standard ORM calls
self.rattail_config.beaker_invalidate_setting(setting.name)
def deletable_instance(self, setting): def deletable_instance(self, setting):
if self.rattail_config.demo(): if self.rattail_config.demo():
return not bool(self.feedback.match(setting.name)) return not bool(self.feedback.match(setting.name))