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') tp = self.fields.get('type')
if not tp: if not tp:
return return
choices = tp.choices excluded_value = TicketType.general
choices.pop(TicketType.general, None) self.fields['type'].choices = [
tp.choices = choices (value, label) for value, label in tp.choices.items() if value != excluded_value
]
@classmethod @classmethod
def setup_eager_loading(cls, queryset): def setup_eager_loading(cls, queryset):