Skip to content

Commit

Permalink
fix: change in name property function (#2135)
Browse files Browse the repository at this point in the history
* fix: quick fix changing where we're pulling name

* fix: test fixes

* fix: version bump

* fix: Update CHANGELOG.rst
  • Loading branch information
kiram15 authored Jun 20, 2024
1 parent 777782f commit a781d6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[4.20.7]
--------
* fix: add name from profile to group membership details

[4.20.6]
--------
* refactor: Removes ``career_engagement_network_message`` from ``EnterpriseCustomer``.
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "4.20.6"
__version__ = "4.20.7"
8 changes: 7 additions & 1 deletion enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,10 @@ def user(self):
except User.DoesNotExist:
return None

@cached_property
def user_profile(self):
return getattr(self.user, 'profile', None)

@property
def user_email(self):
"""
Expand All @@ -1168,7 +1172,9 @@ def name(self):
"""
Return linked user's name.
"""
if self.user is not None:
if self.user_profile is not None:
return f"{self.user_profile.name}"
elif self.user is not None:
return f"{self.user.first_name} {self.user.last_name}"
return None

Expand Down

0 comments on commit a781d6d

Please sign in to comment.