Reverted: Administrator can be deleted by other manager. (partly reverted 533c65562d
after discus it with oskar because import also possible as non-admin)
This commit is contained in:
parent
e5262ea983
commit
cbd04327bb
@ -93,10 +93,12 @@
|
|||||||
<a href="{% url user_edit user.id %}">
|
<a href="{% url user_edit user.id %}">
|
||||||
<img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit participant' %}">
|
<img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit participant' %}">
|
||||||
</a>
|
</a>
|
||||||
{% if user != request_user and not user.is_superuser %}
|
{% if user != request_user %}
|
||||||
<a href="{% url user_delete user.id %}">
|
<a href="{% url user_delete user.id %}">
|
||||||
<img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete participant' %}">
|
<img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete participant' %}">
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if user != request_user and not user.is_superuser %}
|
||||||
<a class="status_link deactivate" href="{% url user_status_deactivate user.id %}" title="{% trans 'Change status to inactive' %}"{% if not user.is_active %} style="display:none"{% endif %}>
|
<a class="status_link deactivate" href="{% url user_status_deactivate user.id %}" title="{% trans 'Change status to inactive' %}"{% if not user.is_active %} style="display:none"{% endif %}>
|
||||||
<span></span>
|
<span></span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -208,8 +208,6 @@ class UserDeleteView(DeleteView):
|
|||||||
def pre_redirect(self, request, *args, **kwargs):
|
def pre_redirect(self, request, *args, **kwargs):
|
||||||
if self.get_object() == self.request.user:
|
if self.get_object() == self.request.user:
|
||||||
messages.error(request, _("You can not delete yourself."))
|
messages.error(request, _("You can not delete yourself."))
|
||||||
elif self.get_object().is_superuser:
|
|
||||||
messages.error(request, _("You can not delete the administrator."))
|
|
||||||
else:
|
else:
|
||||||
super(DeleteView, self).pre_redirect(request, *args, **kwargs)
|
super(DeleteView, self).pre_redirect(request, *args, **kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user