From b7e3d378720bae55b7030efda88fd006ea5295d5 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Tue, 17 Oct 2023 14:03:48 +0200 Subject: [PATCH] Handle properly empty folder list when creating project --- core/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/views.py b/core/views.py index 575b3f2..89001ae 100644 --- a/core/views.py +++ b/core/views.py @@ -889,13 +889,13 @@ def test_func(self): return RoleAssignment.is_access_allowed(user=self.request.user, perm=Permission.objects.get(codename='add_project'), folder=Folder.objects.get(id=self.request.POST['folder'])) -class ProjectCreateViewModal(UserPassesTestMixin, CreateViewModal): +class ProjectCreateViewModal(CreateViewModal, UserPassesTestMixin): model = Project context_object_name = 'project' form_class = ProjectForm def test_func(self): - return RoleAssignment.is_access_allowed(user=self.request.user, perm=Permission.objects.get(codename='add_project'), folder=Folder.objects.get(id=self.request.POST['folder'])) + return RoleAssignment.is_access_allowed(user=self.request.user, perm=Permission.objects.get(codename="add_project"), folder=Folder.objects.get(id=self.request.POST['folder'])) class ProjectUpdateView(BaseContextMixin, UserPassesTestMixin, UpdateView):