From 10ddcbea3732b1c066458aea533480f2bb399ef5 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Tue, 15 May 2018 20:17:53 +0100 Subject: Add snowflake index on oauth_data and use it for deletions We were using id previously, but that was no longer the correct key --- pysite/views/api/bot/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pysite/views/api') diff --git a/pysite/views/api/bot/user.py b/pysite/views/api/bot/user.py index 077991f5..58963682 100644 --- a/pysite/views/api/bot/user.py +++ b/pysite/views/api/bot/user.py @@ -52,7 +52,7 @@ class UserView(APIView, DBMixin): all_oauth_data = self.db.run(self.db.query(self.oauth_table_name), coerce=list) for item in all_oauth_data: - if item["id"] not in user_ids: + if item["snowflake"] not in user_ids: self.db.delete(self.oauth_table_name, item["id"], durability="soft") oauth_deletions += 1 @@ -94,7 +94,7 @@ class UserView(APIView, DBMixin): oauth_deletions = self.db.run( self.db.query(self.oauth_table_name) - .get_all(*user_ids) + .get_all(*user_ids, index="snowflake") .delete() ).get("deleted", 0) -- cgit v1.2.3