@handle_response_format
@treeio_login_required
def ticket_set_status(request, ticket_id, status_id, response_format='html'):
 ticket = get_object_or_404(Ticket, pk=ticket_id)
 if (not request.user.profile.has_permission(ticket, mode='w')):
  return user_denied(request, message="You don't have access to this Ticket")
 status = get_object_or_404(TicketStatus, pk=status_id)
 if (not request.user.profile.has_permission(status)):
  return user_denied(request, message="You don't have access to this Ticket Status")
 if (not (ticket.status == status)):
  ticket.status = status
  ticket.save()
 return ticket_view(request, ticket_id, response_format)

@ handle_response_format @ treeio_login_required def ticket_set_status ( request , ticket_id , status_id , response_format = 'html' ) : ticket = get_object_or_404 ( Ticket , pk = ticket_id ) if ( not request . user . profile . has_permission ( ticket , mode = 'w' ) ) : return user_denied ( request , message = "You don't have access to this Ticket" ) status = get_object_or_404 ( TicketStatus , pk = status_id ) if ( not request . user . profile . has_permission ( status ) ) : return user_denied ( request , message = "You don't have access to this Ticket Status" ) if ( not ( ticket . status == status ) ) : ticket . status = status ticket . save ( ) return ticket_view ( request , ticket_id , response_format )
ticket quick set: status .