From 2398f5e55776730467356cc056effeb05c5bd783 Mon Sep 17 00:00:00 2001 From: bios000 <3540970872@qq.com> Date: Tue, 28 Feb 2023 22:17:14 +0800 Subject: [PATCH] fix delete taskconfigitem bug --- modules/account/constants.py | 2 +- modules/task/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/account/constants.py b/modules/account/constants.py index 6c82ec2..87e0ce5 100644 --- a/modules/account/constants.py +++ b/modules/account/constants.py @@ -16,5 +16,5 @@ REGISTER_TYPE = Enumeration([ (0, "REFUSE", "refuse"), (1, "EMAIL", "email"), - (3, "INVITE", "invite"), + (2, "INVITE", "invite"), ]) diff --git a/modules/task/views.py b/modules/task/views.py index f7ecebe..babaac9 100644 --- a/modules/task/views.py +++ b/modules/task/views.py @@ -305,8 +305,8 @@ def delete_config(self, request, *args, **kwargs): with transaction.atomic(): task_id = task_config.task_id - TaskConfig.objects.get(id=task_config_id).delete() - TaskConfigItem.objects.get(task_config_id=task_config_id).delete() + TaskConfig.objects.filter(id=task_config_id).delete() + TaskConfigItem.objects.filter(task_config_id=task_config_id).delete() queryset = self.filter_queryset( TaskConfigItem.objects.filter(task_config__task__user=self.request.user.id, task_id=task_id))