fix: 工单列表类型没有翻译

pull/12379/head^2
wangruidong 2023-12-20 10:53:21 +08:00 committed by Bryan
parent e18e019460
commit 9b2b71dddc
1 changed files with 4 additions and 3 deletions

View File

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