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

(cherry picked from commit 53c47bb095b4d885408d1f13589d23673230e520)
  • Loading branch information
navinkarkera committed Apr 9, 2024
1 parent 08f2769 commit 8ad8454
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 8ad8454

Please sign in to comment.