From 83b9adbd6117628adaeb1803241a042e88c8f402 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 1 May 2017 21:16:10 -0700 Subject: [PATCH] Add more uncache points to help with stale data --- etiquette/objects.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 3d7da4e..689b966 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -85,6 +85,7 @@ class GroupableMixin: 'INSERT INTO %s VALUES(?, ?)' % self.group_table, [self.id, member.id] ) + self._uncache() if commit: self.photodb.log.debug('Committing - add to group') self.photodb.commit() @@ -149,6 +150,7 @@ class GroupableMixin: 'DELETE FROM %s WHERE memberid == ?' % self.group_table, [self.id] ) + self._uncache() if commit: self.photodb.log.debug('Committing - delete tag') self.photodb.commit() @@ -195,6 +197,7 @@ class GroupableMixin: 'DELETE FROM %s WHERE memberid == ?' % self.group_table, [self.id] ) + self._uncache() if commit: self.photodb.log.debug('Committing - leave group') self.photodb.commit() @@ -968,6 +971,7 @@ class Tag(ObjectBase, GroupableMixin): def _uncache(self): self.photodb.caches['tag'].remove(self.id) + self._cached_qualified_name = None @decorators.transaction def add_synonym(self, synname, *, commit=True):