From 054d385ffcf25b73b347d01f4aa9da58c2d8c654 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 5 Sep 2024 15:49:58 +0800 Subject: [PATCH] perf: Acl action add notify and warn --- apps/acls/const.py | 1 + apps/acls/serializers/base.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/acls/const.py b/apps/acls/const.py index 3c03d8e2d..f36bfc21e 100644 --- a/apps/acls/const.py +++ b/apps/acls/const.py @@ -8,3 +8,4 @@ class ActionChoices(models.TextChoices): review = 'review', _('Review') warning = 'warning', _('Warn') notice = 'notice', _('Notify') + notify_and_warn = 'notify_and_warn', _('Notify and warn') diff --git a/apps/acls/serializers/base.py b/apps/acls/serializers/base.py index 09f75bf42..4dfa56b9f 100644 --- a/apps/acls/serializers/base.py +++ b/apps/acls/serializers/base.py @@ -62,7 +62,7 @@ class ActionAclSerializer(serializers.Serializer): self.set_action_choices() class Meta: - action_choices_exclude = [ActionChoices.warning] + action_choices_exclude = [ActionChoices.warning, ActionChoices.notify_and_warn] def set_action_choices(self): field_action = self.fields.get("action")