diff --git a/src/key_tables.py b/src/key_tables.py index 3b1740d..53dd564 100644 --- a/src/key_tables.py +++ b/src/key_tables.py @@ -59,7 +59,7 @@ def get_key_for_table(game_table_id, cursor): ) row = cursor.fetchone() - if len(row) == 0: + if row == None: return None return KeyTable(row[0], row[1]) diff --git a/src/main.py b/src/main.py index 0df2366..15b3ce9 100644 --- a/src/main.py +++ b/src/main.py @@ -103,9 +103,9 @@ def deactivate_table(table_id): table.active = False if key != None: key.release() + key.commit(cursor) table.commit(cursor) - key.commit(cursor) cursor.close() db.commit() return jsonify(table.toJson())