mirror of https://github.com/jumpserver/jumpserver
fix: 具有超级工单权限的用户申请工单可以指定给某人 (#10596)
parent
3626bf8df6
commit
51e5733f1c
|
@ -64,7 +64,6 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet):
|
||||||
|
|
||||||
def perform_create(self, serializer):
|
def perform_create(self, serializer):
|
||||||
instance = serializer.save()
|
instance = serializer.save()
|
||||||
instance.applicant = self.request.user
|
|
||||||
instance.save(update_fields=['applicant'])
|
instance.save(update_fields=['applicant'])
|
||||||
instance.open()
|
instance.open()
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ class TicketApplySerializer(TicketSerializer):
|
||||||
org_id = serializers.CharField(
|
org_id = serializers.CharField(
|
||||||
required=True, max_length=36, allow_blank=True, label=_("Organization")
|
required=True, max_length=36, allow_blank=True, label=_("Organization")
|
||||||
)
|
)
|
||||||
|
applicant = serializers.CharField(required=False, allow_blank=True)
|
||||||
|
|
||||||
def get_applicant(self, applicant_id):
|
def get_applicant(self, applicant_id):
|
||||||
current_user = self.context['request'].user
|
current_user = self.context['request'].user
|
||||||
|
|
Loading…
Reference in New Issue