sabueso / ticketator

Django simple ticketing system
53 stars 17 forks source link

FieldError on /tickets/ #81

Closed pasqualguerrero closed 6 years ago

pasqualguerrero commented 6 years ago

FieldError at /tickets/ Cannot parse keyword query as dict

/code/ticketatorapp/core/views_tickets.py in list_tickets
@login_required
def list_tickets(request, assigned_state=None):
    common_data = common_ticket_data()
    queues = rights.get_queues_as_q_for_ticket_model(request.user)
    states = State.objects.all()
    # We pass always granted_queues as a roundup to query_view requirements
    if not assigned_state:
        tickets = Ticket.objects.filter(queues) \ ...
                                .filter(Q(assigned_state=2) | Q(assigned_state=1)) \
                                .order_by('-id')
    else:
        tickets = Ticket.objects.filter(queues) \
                                .filter(assigned_state=assigned_state) \