fix: hide 'become user' button on own profile

Resolves #89
This commit is contained in:
James Graham
2021-04-19 12:09:38 +01:00
parent 78056c7752
commit 9f5253834f

View File

@@ -68,7 +68,7 @@
href="{% url 'password_change' %}?next={{ person.get_absolute_url }}">Change Password</a> href="{% url 'password_change' %}?next={{ person.get_absolute_url }}">Change Password</a>
{% endif %} {% endif %}
{% if request.user.is_superuser and person.user %} {% if request.user.is_superuser and person.user and person.user != request.user %}
<form style="display: inline;" action="/hijack/{{ person.user.pk }}/" method="post"> <form style="display: inline;" action="/hijack/{{ person.user.pk }}/" method="post">
{% csrf_token %} {% csrf_token %}
<button class="btn btn-warning" type="submit">Become {{ person.name }}</button> <button class="btn btn-warning" type="submit">Become {{ person.name }}</button>