pref: applet detail api 支持 slug name

This commit is contained in:
ibuler
2022-11-02 15:01:52 +08:00
parent f6fe673b28
commit 956367cfed
4 changed files with 16 additions and 9 deletions

View File

@@ -68,7 +68,8 @@ class TicketApproveSerializer(TicketSerializer):
class TicketApplySerializer(TicketSerializer):
org_id = serializers.CharField(
required=True, max_length=36, allow_blank=True, label=_("Organization")
required=True, max_length=36,
allow_blank=True, label=_("Organization")
)
class Meta:
@@ -92,7 +93,8 @@ class TicketApplySerializer(TicketSerializer):
ticket_type = attrs.get('type')
org_id = attrs.get('org_id')
flow = TicketFlow.get_org_related_flows(org_id=org_id).filter(type=ticket_type).first()
flow = TicketFlow.get_org_related_flows(org_id=org_id)\
.filter(type=ticket_type).first()
if flow:
attrs['flow'] = flow
else: