Handling deleted users when deleting spam accounts.

This commit is contained in:
Samuel Clay 2020-01-18 14:37:44 -05:00
parent 2c7d564f37
commit 14a1e8ab0b

View file

@ -117,7 +117,7 @@ class Profile(models.Model):
follower_profile = MSocialProfile.objects.get(user_id=follower)
follower_profile.unfollow_user(self.user.pk)
social_profile.delete()
except MSocialProfile.DoesNotExist:
except (MSocialProfile.DoesNotExist, IndexError):
logging.user(self.user, " ***> No social profile found. S'ok, moving on.")
pass