Fix backoff exception handling for delete_user

This commit is contained in:
ErikKalkoken
2020-05-24 19:13:31 +02:00
parent b4cc325b07
commit 953c09c999
11 changed files with 406 additions and 81 deletions

View File

@@ -136,7 +136,9 @@ class DiscordUserManager(models.Manager):
only checks locally, does not hit the API
"""
return True if hasattr(user, self.model.USER_RELATED_NAME) else False
if not isinstance(user, User):
return False
return self.filter(user=user).select_related('user').exists()
@classmethod
def generate_bot_add_url(cls):