From 1875068a2f86a5284cffab8bba7b46156e363d63 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 10 Jan 2016 23:04:10 +0530 Subject: [PATCH] more list cache removals (followup to bc593b65) --- oml/item/api.py | 4 ---- oml/setup.py | 2 -- oml/user/api.py | 1 - 3 files changed, 7 deletions(-) diff --git a/oml/item/api.py b/oml/item/api.py index fb66043..4beb8e7 100644 --- a/oml/item/api.py +++ b/oml/item/api.py @@ -153,7 +153,6 @@ def edit(data): for key in list(state.cache): if key.startswith('group:'): state.cache.delete(key) - state.user().clear_smart_list_cache() return response actions.register(edit, cache=False) @@ -168,9 +167,6 @@ def remove(data): if 'ids' in data and data['ids']: for i in models.Item.query.filter(models.Item.id.in_(data['ids'])): i.remove_file() - u = state.user() - u.clear_smart_list_cache() - u.clear_list_cache() return { 'items': [] } diff --git a/oml/setup.py b/oml/setup.py index 73e9525..cf6e63b 100644 --- a/oml/setup.py +++ b/oml/setup.py @@ -327,14 +327,12 @@ def upgrade_db(old, new=None): if not i in l.items: l.items.append(i) session.add(l) - u.clear_list_cache() for u in User.query.filter_by(peered=True): l = u.library for i in u.items.all(): if not i in l.items: l.items.append(i) session.add(l) - u.clear_list_cache() l.items_count() session.commit() if old <= '20160107-508-a0c1970': diff --git a/oml/user/api.py b/oml/user/api.py index dadbb90..289a712 100644 --- a/oml/user/api.py +++ b/oml/user/api.py @@ -183,7 +183,6 @@ def editList(data): if l.type == 'static' and name != l.name: Changelog.record(state.user(), 'editlist', name, {'name': l.name}) l.save() - l.user.clear_smart_list_cache() return l.json() actions.register(editList, cache=False)