diff --git a/routes/dashboard.py b/routes/dashboard.py index e22babc..ee1ef21 100644 --- a/routes/dashboard.py +++ b/routes/dashboard.py @@ -377,10 +377,12 @@ def create_command(): # Assign position = one more than the current max for this town's pending build queue if cmd_type == 'build': - pos_row = c.execute(''' - SELECT MAX(position) as max_pos FROM commands - WHERE player_id = ? AND town_id = ? AND type = 'build' AND status IN (''pending'', ''executing'') - ''', (str(data['player_id']), str(data['town_id']))).fetchone() + pos_row = c.execute( + "SELECT MAX(position) as max_pos FROM commands" + " WHERE player_id = ? AND town_id = ? AND type = 'build'" + " AND status IN ('pending', 'executing')", + (str(data['player_id']), str(data['town_id'])) + ).fetchone() position = (pos_row['max_pos'] or 0) + 1 else: position = None