perf: model_to_dict无法转换不可编辑字段,导致消息中有的值为None

pull/12376/head
jiangweidong 2023-12-19 16:26:21 +08:00 committed by Bryan
parent 2b41486f2a
commit fda3e6ec9b
1 changed files with 2 additions and 0 deletions

View File

@ -75,6 +75,8 @@ class BaseTicketMessage(UserMessage):
field = fields[name]
item = {'name': name, 'title': field.verbose_name}
value = self.ticket.get_field_display(name, field, data)
if not value:
continue
item['value'] = value
items.append(item)
return items