Skip to content

Commit

Permalink
add ability to reassign a ticket #3
Browse files Browse the repository at this point in the history
  • Loading branch information
michivonah committed May 7, 2023
1 parent e1c4e02 commit db16731
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pages/tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ def openTicket(ticketid):
ticketClosed = st.checkbox('Ticket closed', False)
else:
ticketClosed = st.checkbox('Ticket closed', True)
users = getSelectableList('username', 'userlist')
ticketAssignment = st.selectbox('Assign to', users)
usersList = list(getSelectableList('username', 'user'))
assignedName = db.executeQuery(f"SELECT username FROM \"user\" WHERE userid = {ticketInfo[0][5]}")[0][0]
usersList.remove(assignedName)
usersList = [assignedName] + usersList
assignmentBox = st.selectbox('Assign to', usersList)
saveBtn = st.button('Save changes')
if saveBtn:
updateTicket(ticketid, ticketName, ticketDescription, ticketClosed, ticketAssignment)
updateTicket(ticketid, ticketName, ticketDescription, ticketClosed, assignmentBox)

def updateTicket(ticketid, name, desc, closed, assignment):
if closed:
Expand Down

0 comments on commit db16731

Please sign in to comment.