From fa4ab9f54a92afea3fc1d1065a2b0cdd12e0fe48 Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Wed, 5 Apr 2023 18:27:35 +0200 Subject: [PATCH] Fix #604 --- trombi/templates/trombi/user_tools.jinja | 18 +++++++++--------- trombi/views.py | 4 +++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/trombi/templates/trombi/user_tools.jinja b/trombi/templates/trombi/user_tools.jinja index 19056111..0a45742b 100644 --- a/trombi/templates/trombi/user_tools.jinja +++ b/trombi/templates/trombi/user_tools.jinja @@ -38,18 +38,18 @@
{{ u.user.get_display_name() }}
{% if trombi.show_profiles %} -
- {% trans %}Profile{% endtrans %} -
+
+ {% trans %}Profile{% endtrans %} +
{% endif %}
{% if can_comment %} - {% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %} - {% if comment %} - {% trans %}Edit comment{% endtrans %} - {% else %} - {% trans %}Comment{% endtrans %} - {% endif %} + {% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %} + {% if comment %} + {% trans %}Edit comment{% endtrans %} + {% else %} + {% trans %}Comment{% endtrans %} + {% endif %} {% endif %}
diff --git a/trombi/views.py b/trombi/views.py index 590d98fc..e5275799 100644 --- a/trombi/views.py +++ b/trombi/views.py @@ -462,8 +462,10 @@ class UserTrombiProfileView(TrombiTabsMixin, DetailView): def get(self, request, *args, **kwargs): self.object = self.get_object() + if ( - self.object.trombi.id != request.user.trombi_user.trombi.id + request.user.is_anonymous + or self.object.trombi.id != request.user.trombi_user.trombi.id or self.object.user.id == request.user.id or not self.object.trombi.show_profiles ):