Commit 8b3c3140 by Guba Sándor

Merge branch 'issue-415' into 'master'

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

See merge request !337
parents 5dc8d211 96b3ed43
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
{% block navbar %} {% 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"> <ul class="nav navbar-nav navbar-right" id="dashboard-menu">
{% if user.is_superuser %} {% if request.user.is_superuser %}
{% if ADMIN_ENABLED %} {% if ADMIN_ENABLED %}
<li> <li>
<a href="/admin/"> <a href="/admin/">
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<li> <li>
<a href="{% url "dashboard.views.profile-preferences" %}"> <a href="{% url "dashboard.views.profile-preferences" %}">
<i class="fa fa-user"></i> <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> </a>
</li> </li>
<li> <li>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</li> </li>
<li class="hidden-xs"> <li class="hidden-xs">
<a href="{% url "dashboard.views.profile-preferences" %}"> <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> </a>
</li> </li>
</ul> </ul>
......
...@@ -94,6 +94,8 @@ class RequestDetail(LoginRequiredMixin, DetailView): ...@@ -94,6 +94,8 @@ class RequestDetail(LoginRequiredMixin, DetailView):
context['action'] = request.action context['action'] = request.action
context['accept_states'] = ResourcesOperation.accept_states context['accept_states'] = ResourcesOperation.accept_states
# workaround for http://git.io/vIIYi
context['request'] = self.request
return context 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