diff --git a/dislocker_auth.py b/dislocker_auth.py index 6befeae..c819015 100644 --- a/dislocker_auth.py +++ b/dislocker_auth.py @@ -304,9 +304,6 @@ class Auth(): cursor = self.db.cursor() pc_number = int(kwargs["pc_number"]) pc_uuid = str(kwargs["pc_uuid"]) - cursor.execute("SELECT pc_uuid FROM pc_list WHERE pc_number = %s", (pc_number,)) - pc_record_uuid_source = cursor.fetchall() - pc_record_uuid = pc_record_uuid_source[0][0] cursor.execute("SELECT pc_number FROM pc_list WHERE pc_number = %s", (pc_number,)) pc_record_number_source = cursor.fetchall() @@ -318,6 +315,9 @@ class Auth(): self.db.commit() return {"result": 0, "about": "ok", "output_dict": {"pc_token": pc_token, "master_password": master_password, "master_password_hash": master_password_hash}} else: + cursor.execute("SELECT pc_uuid FROM pc_list WHERE pc_number = %s", (pc_number,)) + pc_record_uuid_source = cursor.fetchall() + pc_record_uuid = pc_record_uuid_source[0][0] if pc_record_uuid == None: pc_token = self.token_generate(36) master_password = self.master_password_generate(16)