mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Don't attempt to update access if the user is in mid deletion
This commit is contained in:
@@ -29,8 +29,13 @@ task_failure.connect(process_failure_signal)
|
||||
|
||||
# Signals that the tasks need to listen for
|
||||
def eveapi_deleted(sender, instance, **kwargs):
|
||||
if instance.user:
|
||||
update_user_access.delay(user=instance.user.id)
|
||||
try:
|
||||
u = instance.user
|
||||
except User.DoesNotExist:
|
||||
pass
|
||||
else:
|
||||
if u:
|
||||
update_user_access.delay(user=u.id)
|
||||
|
||||
signals.post_delete.connect(eveapi_deleted, sender=EVEAccount)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user