perf: 修改 labels 搜索 (#12379)

* perf: 修改标签的搜索

* perf: 修改 labels 搜索

---------

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2023-12-20 14:31:03 +08:00
committed by GitHub
parent ac5991fc43
commit 6544f8ade8
2 changed files with 4 additions and 14 deletions

View File

@@ -39,10 +39,9 @@ class TicketSerializer(OrgResourceModelSerializerMixin):
tp = self.fields.get('type')
if not tp:
return
excluded_value = TicketType.general
self.fields['type'].choices = [
(value, label) for value, label in tp.choices.items() if value != excluded_value
]
choices = tp.choices
choices.pop(TicketType.general, None)
tp.choices = choices.items()
@classmethod
def setup_eager_loading(cls, queryset):