Skip to content

Commit

Permalink
Merge pull request #191 from zediious/0.5.2.2
Browse files Browse the repository at this point in the history
Changes for 0.5.2.2
  • Loading branch information
zediious authored Jun 16, 2024
2 parents c496f2c + 46125d7 commit e3715fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions raptorWeb/authprofiles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ def pre_save_raptor_user(sender, instance, *args, **kwargs):
If a Raptoruser's Username is changed, update their User Slug to a slufigied
version of the new username
"""
if instance.username != RaptorUser.objects.get(pk=instance.pk).username:
instance.user_slug = slugify(instance.username)


try:
changed_user = RaptorUser.objects.get(pk=instance.pk)
if instance.username != changed_user.username:
instance.user_slug = slugify(instance.username)

except RaptorUser.DoesNotExist:
pass

0 comments on commit e3715fc

Please sign in to comment.