Verified Commit f2ed8290 authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

Fix Join on queue

parent cff8439d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ def create_queue(name, weight, meta):

def get_queue_elements_list(qid):
    elems = []
    for ql in PrintRequest.select().join(QueueElement).where((QueueElement.queue.id == qid and QueueElement.state == QUEUE_ELEMENT_STATE_INQUEUE)).group_by(QueueElement.id).order_by(QueueElement.id):
    for ql in PrintRequest.select().join(QueueElement, on=(PrintRequest.queue_element == QueueElement.id)).where((QueueElement.queue.id == qid and QueueElement.state == QUEUE_ELEMENT_STATE_INQUEUE)).order_by(QueueElement.id):
       elems.append({
            "id": ql.id,
            "author": ql.author.fullname,