Handle both admin and non-admin user names in update user template

When an admin user goes to the UpdateUser view of a different user, the template
gets only one username which is of the user being updated. This causes the admin
user's name being overwritten in the header section thus making it appear that
the user is modifying themselves and not the admin. This can cause confusion to
the admin user.

Explicitly getting the name of the user that made the request ensures that we
always get the correct username.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2017-10-19 20:22:34 +05:30 committed by James Valleroy
parent aa41f80b16
commit d755d42a76
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -131,7 +131,7 @@
class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-expanded="false">
<i class="glyphicon glyphicon-user nav-icon"></i>
{{ user.username }}
{{ request.user.username }}
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">