From c36f68300a919f9e526387b65fc6cc872148b353 Mon Sep 17 00:00:00 2001 From: gzbender Date: Tue, 17 Jul 2018 22:05:22 +0500 Subject: [PATCH] =?UTF-8?q?LIL-572=20=D0=9D=D0=B5=D0=B7=D0=B0=D1=80=D0=B5?= =?UTF-8?q?=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=20=D0=BD=D0=B5=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B8=D1=82=20=D0=BA=D1=83=D1=80=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/templates/user/profile.html | 14 ++++++-------- apps/user/views.py | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html index caddc204..6b0f0b07 100644 --- a/apps/user/templates/user/profile.html +++ b/apps/user/templates/user/profile.html @@ -62,22 +62,22 @@ -{% if not guest %}
+ {% if owner %} - {% if not simple_user %} - - {% endif %}
+ {% if owner %}
{% if is_purchased_future %}
@@ -126,8 +126,8 @@
- {% if not simple_user %} -
+ {% endif %} +
{% if published.exists %} @@ -145,10 +145,8 @@
- {% endif %}
-{% endif %} {% endblock content %} diff --git a/apps/user/views.py b/apps/user/views.py index 14ecef7b..500d8404 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -56,6 +56,7 @@ class UserView(DetailView): else: context['simple_user'] = True context['guest'] = True + context['owner'] = self.request.user.id == self.object.id if context['guest'] and self.object.role <= User.USER_ROLE: raise Http404()