Skip to content
Snippets Groups Projects
Commit bfb820a6 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Change User class string representation to username

Having the username in the API is more useful than the display name.
We keep the display name in the UI.

Fix INFRA-241
parent 15d5e2a6
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ class User(db.Model, UserMixin):
return bool(set(self.groups) & set(names))
def __str__(self):
return self.display_name
return self.username
def to_dict(self):
return {
......
......@@ -35,7 +35,7 @@
{% if current_user.is_authenticated %}
<div class="dropdown {{ is_active(path == "/user/profile") }}">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{current_user}}
{{ current_user.display_name }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="{{ url_for('user.profile') }}">Profile</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment