fix: 具有超级工单权限的用户申请工单可以指定给某人 (#10596)

pull/10598/head
jiangweidong 2 years ago committed by GitHub
parent 3626bf8df6
commit 51e5733f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -64,7 +64,6 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet):
def perform_create(self, serializer):
instance = serializer.save()
instance.applicant = self.request.user
instance.save(update_fields=['applicant'])
instance.open()

@ -59,6 +59,7 @@ class TicketApplySerializer(TicketSerializer):
org_id = serializers.CharField(
required=True, max_length=36, allow_blank=True, label=_("Organization")
)
applicant = serializers.CharField(required=False, allow_blank=True)
def get_applicant(self, applicant_id):
current_user = self.context['request'].user

Loading…
Cancel
Save