Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Nov 27, 2024
1 parent b3b3ef8 commit dcd9b77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lemarche/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ def update_api_key_last_update(sender, instance, **kwargs):
try:
old_instance = sender.objects.get(pk=instance.pk)
if old_instance.api_key != instance.api_key:
# Add the old key to the list of old keys
instance.api_key_last_updated = timezone.now()
except sender.DoesNotExist:
instance.api_key_last_updated = timezone.now()
else:
if instance.api_key:
instance.api_key_last_updated = timezone.now()
elif instance.api_key:
instance.api_key_last_updated = timezone.now()


Expand Down

0 comments on commit dcd9b77

Please sign in to comment.