Skip to content

Commit

Permalink
feat: use profile name in navbar if available
Browse files Browse the repository at this point in the history
Makes use of name field from user profile field if it is not empty
  • Loading branch information
navinkarkera committed Jul 18, 2024
1 parent 058870e commit 1d0f0b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lms/templates/header/user_dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
self.real_user = getattr(user, 'real_user', user)
profile_image_url = get_profile_image_urls_for_user(self.real_user)['medium']
username = self.real_user.username
displayname = get_enterprise_learner_generic_name(request) or username
profile = getattr(self.real_user, 'profile', None)
name = getattr(profile, 'name', username)
displayname = get_enterprise_learner_generic_name(request) or name
enterprise_customer_portal = get_enterprise_learner_portal(request)
## Enterprises with the learner portal enabled should not show order history, as it does
## not apply to the learner's method of purchasing content.
Expand Down

0 comments on commit 1d0f0b9

Please sign in to comment.