Follow recommendation to use == instead of keyword is

This commit is contained in:
Garret Wassermann 2019-12-17 08:41:30 -05:00
parent 0f52aecb5c
commit 1784d5cf60

View File

@ -510,7 +510,7 @@ def update_ticket(request, ticket_id, public=False):
# render the neutralized template
comment = template_func(comment).render(context)
if owner is -1 and ticket.assigned_to:
if owner == -1 and ticket.assigned_to:
owner = ticket.assigned_to.id
f = FollowUp(ticket=ticket, date=timezone.now(), comment=comment,
@ -524,7 +524,7 @@ def update_ticket(request, ticket_id, public=False):
reassigned = False
old_owner = ticket.assigned_to
if owner is not -1:
if owner != -1:
if owner != 0 and ((ticket.assigned_to and owner != ticket.assigned_to.id) or not ticket.assigned_to):
new_user = User.objects.get(id=owner)
f.title = _('Assigned to %(username)s') % {