Commit 9287be16 authored by ∞'s avatar 💻

Show real name for become user

parent 6ee88ab0
......@@ -10,7 +10,7 @@
</li>
{% if request.session.become_user %}
<li class="{{ liclass|default('') }}">
<a data-noprefetch="true" href="{{ url('crudlfap:su') }}">{{ _('Back to your account') }}</a>
<a data-noprefetch="true" href="{{ url('crudlfap:su') }}">{{ _('Back to your account') }} ({{ request.session.become_user_realname }})</a>
</li>
{% endif %}
{% endif %}
......@@ -71,8 +71,10 @@ class BecomeUser(crudlfap.ObjectView):
def get(self, request, *a, **k):
logger.info('BecomeUser by {}'.format(self.request.user))
become_user_realname = str(self.request.user)
become_user = request.session.get('become_user', request.user.pk)
auth.login(request, self.object)
request.session.setdefault('become_user_realname', become_user_realname)
request.session['become_user'] = become_user
messages.info(
request,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment