mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-05 09:21:54 +02:00
Fix signals
This commit is contained in:
parent
e077892659
commit
89071bc2e2
2 changed files with 3 additions and 3 deletions
|
@ -59,12 +59,12 @@ class Contact(TimeStampedModel):
|
|||
names = [n for n in [self.first_name, self.middle_name, self.last_name] if n]
|
||||
return " ".join(names) if names else "Unknown"
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
def save(self, enable_custom_save=True, *args, **kwargs):
|
||||
# Call the parent class's save method to perform the actual save
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
# Update the related User object's first_name and last_name
|
||||
if self.user:
|
||||
if self.user and enable_custom_save:
|
||||
self.user.first_name = self.first_name
|
||||
self.user.last_name = self.last_name
|
||||
self.user.save()
|
||||
|
|
|
@ -46,7 +46,7 @@ def handle_profile(sender, instance, **kwargs):
|
|||
|
||||
if len(contacts) >= 1 and is_new_user: # a matching contact
|
||||
contacts[0].user = instance
|
||||
contacts[0].save()
|
||||
contacts[0].save(enable_custom_save=False)
|
||||
|
||||
if len(contacts) > 1: # multiple matches
|
||||
logger.warning(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue