Fix up unit test

This commit is contained in:
zandercymatics 2024-05-28 11:17:48 -06:00
parent 23988ad6b3
commit c2dd91215a
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 52 additions and 12 deletions

View file

@ -24,9 +24,11 @@ def handle_profile(sender, instance, **kwargs):
"""
first_name = getattr(instance, "first_name", "")
middle_name = getattr(instance, "middle_name", "")
last_name = getattr(instance, "last_name", "")
email = getattr(instance, "email", "")
phone = getattr(instance, "phone", "")
title = getattr(instance, "title", "")
is_new_user = kwargs.get("created", False)
@ -39,9 +41,11 @@ def handle_profile(sender, instance, **kwargs):
Contact.objects.create(
user=instance,
first_name=first_name,
middle_name=middle_name,
last_name=last_name,
email=email,
phone=phone,
title=title,
)
if len(contacts) >= 1 and is_new_user: # a matching contact