Skip to content

Commit

Permalink
Merge pull request #222 from UnitapApp/fix/username-str
Browse files Browse the repository at this point in the history
add str to userprofile to show username in admin panel
  • Loading branch information
Bastin authored Dec 16, 2023
2 parents 2e291bf + 2585aea commit 865afde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def save(self, *args, **kwargs):
self.username = f"User{self.pk}"
super().save(*args, **kwargs)

def __str__(self) -> str:
return self.username if self.username else f"User{self.pk}"

@staticmethod
def user_count():
cached_user_count = cache.get("user_profile_count")
Expand Down

0 comments on commit 865afde

Please sign in to comment.