Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth committed Nov 21, 2023
1 parent 49cabf4 commit e37aca8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions myhpi/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def get_full_name(self):
@receiver(post_save, sender=User)
def post_user_save(sender, instance, created, **kwargs):
display_name = instance.first_name + " " + instance.last_name
user_profile = UserProfile.objects.get(user=instance.pk)
user_profile = UserProfile.objects.filter(user=instance.pk)
if user_profile:
user_profile.display_name = display_name
user_profile.save()
user_profile[0].display_name = display_name
user_profile[0].save()
else:
UserProfile.objects.create(user=instance, display_name=display_name)

Expand Down

0 comments on commit e37aca8

Please sign in to comment.