This commit is contained in:
Nick Leeman 2022-10-09 21:53:21 +02:00
parent e184874163
commit 94d13bb245

View File

@ -38,11 +38,11 @@ class User:
for row in rows: for row in rows:
user = User(Database.connection)._set_row_values(row) user = User(Database.connection)._set_row_values(row)
if user.username == self.username: if user.username == self.username:
self._set_row_values(row)
found_user = user found_user = user
break break
cur.close() cur.close()
if found_user: if found_user:
return True return True
else: else:
@ -75,7 +75,7 @@ class User:
password = ?, password = ?,
role = ? role = ?
WHERE id = ? WHERE id = ?
""", (Encryption.encrypt(self.username), Encryption.encrypt(self.firstname), Encryption.encrypt(self.lastname), Encryption.encrypt(self.address), Encryption.encrypt(self.zipcode), self.city_id, Encryption.encrypt(self.email), Encryption.encrypt(self.phone), self.password, self.role, self.id)) """, (Encryption.encrypt(self.username), Encryption.encrypt(self.firstname), Encryption.encrypt(self.lastname), Encryption.encrypt(self.address), Encryption.encrypt(self.zipcode), self.city_id, Encryption.encrypt(self.email), Encryption.encrypt(self.phone), Encryption.encrypt(self.password), self.role, self.id))
self.connection.commit() self.connection.commit()
cur.close() cur.close()