fix: 解决具有超级工单权限的用户无法给指定人申请工单问题 (#10597)

pull/10776/head
jiangweidong 2023-05-31 10:20:52 +08:00 committed by GitHub
parent c7ea62488d
commit aa52dd51b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

View File

@ -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()

View File

@ -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