Skip to content

Commit

Permalink
fix: 修复提单身份异常问题 --story=119593627 (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
benero authored Oct 11, 2024
1 parent 92b9773 commit 69fc238
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions itsm/ticket/views/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,12 @@ def create(self, request, *args, **kwargs):

# 是否开启代提单
meta = data.get("meta", {})
if service.can_ticket_agency:
username = getattr(request.user, "username", "guest")
if username != data.get("creator"):
username = getattr(request.user, "username", "guest")
if username != data.get("creator"):
if service.can_ticket_agency:
meta = dict(meta, ticket_agent=username)
else:
raise ValidationError(_("用户登录态异常"))

# creator(实际提单人)和updated_by在serializer.to_internal_value(data)中获取
instance = serializer.save(meta=meta)
Expand Down

0 comments on commit 69fc238

Please sign in to comment.