@ -10,7 +10,6 @@ urlpatterns = [
|
|||||||
# path("<int:pk>/edit", organization.Change.as_view(), name="_organization_change"),
|
# path("<int:pk>/edit", organization.Change.as_view(), name="_organization_change"),
|
||||||
path("<int:organization_id>/team/<int:pk>/", team.View.as_view(), name="_team_view"),
|
path("<int:organization_id>/team/<int:pk>/", team.View.as_view(), name="_team_view"),
|
||||||
path("<int:pk>/team/add", team.Add.as_view(), name="_team_add"),
|
path("<int:pk>/team/add", team.Add.as_view(), name="_team_add"),
|
||||||
path("<int:organization_id>/team/<int:pk>/edit", team.Change.as_view(), name="_team_change"),
|
|
||||||
path("<int:organization_id>/team/<int:pk>/delete", team.Delete.as_view(), name="_team_delete"),
|
path("<int:organization_id>/team/<int:pk>/delete", team.Delete.as_view(), name="_team_delete"),
|
||||||
path("<int:organization_id>/team/<int:pk>/user/add", user.Add.as_view(), name="_team_user_add"),
|
path("<int:organization_id>/team/<int:pk>/user/add", user.Add.as_view(), name="_team_user_add"),
|
||||||
path("<int:organization_id>/team/<int:team_id>/user/<int:pk>/delete", user.Delete.as_view(), name="_team_user_delete"),
|
path("<int:organization_id>/team/<int:team_id>/user/<int:pk>/delete", user.Delete.as_view(), name="_team_user_delete"),
|
||||||
|
@ -85,32 +85,6 @@ class Add(OrganizationPermission, generic.CreateView):
|
|||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
class Change(PermissionRequiredMixin, OrganizationPermission, generic.UpdateView):
|
|
||||||
model = Team
|
|
||||||
permission_required = [
|
|
||||||
'access.change_team',
|
|
||||||
]
|
|
||||||
template_name = 'form.html.j2'
|
|
||||||
fields = [
|
|
||||||
'team_name',
|
|
||||||
'permissions',
|
|
||||||
'organization'
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_success_url(self, **kwargs):
|
|
||||||
return f"/organization/{self.kwargs['pk']}/"
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
|
||||||
context = super().get_context_data(**kwargs)
|
|
||||||
|
|
||||||
context['model_pk'] = self.kwargs['pk']
|
|
||||||
context['model_name'] = self.model._meta.verbose_name.replace(' ', '')
|
|
||||||
|
|
||||||
context['content_title'] = 'Edit Team'
|
|
||||||
|
|
||||||
return context
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Delete(OrganizationPermission, generic.DeleteView):
|
class Delete(OrganizationPermission, generic.DeleteView):
|
||||||
model = Team
|
model = Team
|
||||||
|
Reference in New Issue
Block a user