mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-06 18:15:17 +00:00
Fix #604
This commit is contained in:
parent
79a8fb0654
commit
fa4ab9f54a
@ -39,16 +39,16 @@
|
||||
<div>{{ u.user.get_display_name() }}</div>
|
||||
{% if trombi.show_profiles %}
|
||||
<div>
|
||||
<a href="{{ url("trombi:user_profile", user_id=u.id) }}">{% trans %}Profile{% endtrans %}</a>
|
||||
<a href="{{ url('trombi:user_profile', user_id=u.id) }}">{% trans %}Profile{% endtrans %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if can_comment %}
|
||||
{% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %}
|
||||
{% if comment %}
|
||||
<a href="{{ url("trombi:edit_comment", comment_id=comment.id) }}">{% trans %}Edit comment{% endtrans %}</a>
|
||||
<a href="{{ url('trombi:edit_comment', comment_id=comment.id) }}">{% trans %}Edit comment{% endtrans %}</a>
|
||||
{% else %}
|
||||
<a href="{{ url("trombi:new_comment", user_id=u.id) }}">{% trans %}Comment{% endtrans %}</a>
|
||||
<a href="{{ url('trombi:new_comment', user_id=u.id) }}">{% trans %}Comment{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -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
|
||||
):
|
||||
|
Loading…
x
Reference in New Issue
Block a user