Don't allow to remove the registered group
This commit is contained in:
parent
e7c47395bb
commit
8306e7bf6e
@ -66,7 +66,7 @@
|
||||
</li>
|
||||
|
||||
{# delete group #}
|
||||
{% if group.name != 'Anonymous' %}
|
||||
{% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %}
|
||||
<li>
|
||||
<a href="{% model_url group 'delete' %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete group' %}</a>
|
||||
</li>
|
||||
|
@ -441,7 +441,7 @@ class GroupDeleteView(DeleteView):
|
||||
url = 'user_group_overview'
|
||||
|
||||
def pre_redirect(self, request, *args, **kwargs):
|
||||
if self.get_object().name.lower() == 'anonymous':
|
||||
if self.get_object().name.lower() in ['anonymous', 'registered']:
|
||||
messages.error(request, _("You can not delete this Group."))
|
||||
else:
|
||||
super(GroupDeleteView, self).pre_redirect(request, *args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user