[Update] 修改ticket

This commit is contained in:
ibuler
2019-11-18 11:54:12 +08:00
parent ebe129b3c2
commit 2f4096bf3d
7 changed files with 40 additions and 22 deletions

View File

@@ -78,7 +78,7 @@ class Ticket(CommonModelMixin):
def create_action_comment(self, action, user):
action_display = dict(self.ACTION_CHOICES).get(action)
body = '{} {} {}'.format(user, action_display, _("this order"))
body = '{} {} {}'.format(user, action_display, _("this ticket"))
self.comments.create(body=body, user=user, user_display=str(user))
def perform_action(self, action, user):
@@ -89,6 +89,12 @@ class Ticket(CommonModelMixin):
self.assignees_display = str(user)
self.save()
def is_assignee(self, user):
return self.assignees.filter(id=user.id).exists()
def is_user(self, user):
return self.user == user
class Meta:
ordering = ('-date_created',)