Skip to content

Commit

Permalink
fix: trying to set just deleted email
Browse files Browse the repository at this point in the history
  • Loading branch information
saemideluxe committed Feb 22, 2023
1 parent cc7ad7e commit 7bb3b46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions basxconnect/core/models/persons.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ def save(self, *args, **kwargs):
self.primary_postal_address = None

if hasattr(self, "core_email_list"):
if (
self.core_email_list.all().count() == 1
or self.primary_email_address is None
if self.core_email_list.all().count() == 1 or (
self.core_email_list.all().count() > 0
and self.primary_email_address is None
):
self.primary_email_address = self.core_email_list.first()
else:
Expand Down

0 comments on commit 7bb3b46

Please sign in to comment.