mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 04:50:30 +00:00
fix: ticket bug
This commit is contained in:
@@ -157,6 +157,12 @@ class TicketFlowApproveSerializer(serializers.ModelSerializer):
|
||||
return obj.assignees.values_list('id', flat=True)
|
||||
return []
|
||||
|
||||
def validate(self, attrs):
|
||||
if attrs['strategy'] == TicketApprovalStrategy.custom_user and not attrs.get('assignees'):
|
||||
error = _('Please select the Assignees')
|
||||
raise serializers.ValidationError(error)
|
||||
return super().validate(attrs)
|
||||
|
||||
|
||||
class TicketFlowSerializer(OrgResourceModelSerializerMixin):
|
||||
type_display = serializers.ReadOnlyField(source='get_type_display', label=_('Type display'))
|
||||
|
Reference in New Issue
Block a user