Commit 32f4e1c2 by Oláh István Gergely

dashboard: remove group user in view and template

parent bee83c92
......@@ -39,7 +39,7 @@
<thead><tr><th></th><th>{% trans "Who" %}</th><th></th><th></th></tr></thead>
{% for i in users %}
<tr><td><i class="icon-user"></i></td><td>{{i.username}}</td>
<td><a data-group-pk="{{ i.pk }}" href="#" class="real-link groupuser-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
<td><a data-groupmember-pk="{{i.pk}}" href="{% url "dashboard.views.remove-groupmember" user_pk=i.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupmember-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
{% endfor %}
<tr><td><i class="icon-plus"></i></td>
<td><input type="text" class="form-control" name="perm-new-name"
......
from django.conf.urls import patterns, url
from vm.models import Instance
from .views import (
AclUpdateView, DiskAddView, FavouriteView, GroupAclUpdateView, GroupDelete,
GroupDetailView, GroupList, GroupUserDelete, IndexView, LeaseCreate,
LeaseDelete, LeaseDetail, MyPreferencesView, NodeAddTraitView, NodeCreate,
NodeDelete, NodeDetailView, NodeFlushView, NodeGraphView, NodeList,
NodeStatus, NotificationView, PortDelete, TemplateAclUpdateView,
TemplateCreate, TemplateDelete, TemplateDetail, TemplateList,
TransferOwnershipConfirmView, TransferOwnershipView, vm_activity, VmCreate,
VmDelete, VmDetailView, VmDetailVncTokenView, VmGraphView, VmList,
VmMassDelete, VmMigrateView, VmRenewView,
AclUpdateView, DiskAddView, FavouriteView, GroupAclUpdateView,
GroupDelete, GroupDetailView, GroupList, GroupUserDelete,
IndexView, LeaseCreate, LeaseDelete, LeaseDetail, MyPreferencesView,
NodeAddTraitView, NodeCreate, NodeDelete, NodeDetailView, NodeFlushView,
NodeGraphView, NodeList, NodeStatus, NotificationView, PortDelete,
TemplateAclUpdateView, TemplateCreate, TemplateDelete, TemplateDetail,
TemplateList, TransferOwnershipConfirmView, TransferOwnershipView,
vm_activity, VmCreate, VmDelete, VmDetailView, VmDetailVncTokenView,
VmGraphView, VmList, VmMassDelete, VmMigrateView, VmRenewView,
GroupAclRemoveView, GroupMemberRemoveView
)
from vm.models import Instance
urlpatterns = patterns(
'',
......@@ -93,7 +95,6 @@ urlpatterns = patterns(
name='dashboard.views.group-acl'),
url(r'^groupuser/delete/(?P<pk>\d+)/$', GroupUserDelete.as_view(),
name="dashboard.views.delete-groupuser"),
url(r'^notifications/$', NotificationView.as_view(),
name="dashboard.views.notifications"),
......@@ -101,4 +102,10 @@ urlpatterns = patterns(
name="dashboard.views.disk-add"),
url(r'^profile/$', MyPreferencesView.as_view(),
name="dashboard.views.profile"),
url(r'^group/(?P<group_pk>\d+)/remove/acl/(?P<user_pk>\d+)/$',
GroupAclRemoveView.as_view(),
name="dashboard.views.remove-groupaclmember"),
url(r'^group/(?P<group_pk>\d+)/remove/member/(?P<user_pk>\d+)/$',
GroupMemberRemoveView.as_view(),
name="dashboard.views.remove-groupmember"),
)
......@@ -986,7 +986,7 @@ class GroupUserDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
return reverse_lazy('dashboard.index')
class GroupUserRemoveView(LoginRequiredMixin, DeleteView):
class GroupMemberRemoveView(LoginRequiredMixin, DeleteView):
model = Group
slug_field = 'pk'
slug_url_kwarg = 'group_pk'
......@@ -1026,7 +1026,7 @@ class GroupUserRemoveView(LoginRequiredMixin, DeleteView):
return HttpResponseRedirect(success_url)
class GroupAclRemoveView(GroupUserRemoveView):
class GroupAclRemoveView(GroupMemberRemoveView):
def remove_user(self, userpk):
container = self.get_object().profile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment