From 04515dfa763b49ccefe3a2723f19122366444b6d Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Sun, 6 Sep 2020 20:55:10 +0200 Subject: [PATCH] [twitter] Add removal of twitter corpses on twitter create --- kibicara/platforms/twitter/webapi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kibicara/platforms/twitter/webapi.py b/kibicara/platforms/twitter/webapi.py index b1cd51f..fc7c78b 100644 --- a/kibicara/platforms/twitter/webapi.py +++ b/kibicara/platforms/twitter/webapi.py @@ -121,6 +121,10 @@ async def twitter_create(response: Response, hood=Depends(get_hood)): `https://api.twitter.com/oauth/authorize?oauth_token=` """ try: + # Purge Twitter corpses + for corpse in await Twitter.objects.filter(hood=hood, verified=False).all(): + await corpse.delete() + # Create Twitter request_token = await get_oauth_token( config['twitter']['consumer_key'], config['twitter']['consumer_secret'],