Commit 96b3ed43 by Kálmán Viktor

dashboard: fix user mishandling bug

closes #415

https://github.com/django/django/blob/1.8.2/django/views/generic/detail.py#L105
user and request got overwritten in context
parent 8f05251d
......@@ -11,9 +11,9 @@
{% block navbar %}
{% if user.is_authenticated and user.pk and not request.token_user %}
{% if request.user.is_authenticated and request.user.pk and not request.token_user %}
<ul class="nav navbar-nav navbar-right" id="dashboard-menu">
{% if user.is_superuser %}
{% if request.user.is_superuser %}
{% if ADMIN_ENABLED %}
<li>
<a href="/admin/">
......@@ -56,7 +56,7 @@
<li>
<a href="{% url "dashboard.views.profile-preferences" %}">
<i class="fa fa-user"></i>
{% include "dashboard/_display-name.html" with user=user show_org=True %}
{% include "dashboard/_display-name.html" with user=request.user show_org=True %}
</a>
</li>
<li>
......@@ -89,7 +89,7 @@
</li>
<li class="hidden-xs">
<a href="{% url "dashboard.views.profile-preferences" %}">
<img class="profile-avatar" src="{{ user.profile.get_avatar_url }}" />
<img class="profile-avatar" src="{{ request.user.profile.get_avatar_url }}" />
</a>
</li>
</ul>
......
......@@ -94,6 +94,8 @@ class RequestDetail(LoginRequiredMixin, DetailView):
context['action'] = request.action
context['accept_states'] = ResourcesOperation.accept_states
# workaround for http://git.io/vIIYi
context['request'] = self.request
return context
......
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 sign in to comment