我试图以这种方式设置“条件”,但是它没有用,包含了相同的条件,但是在删除时,仅删除了具有相同用户的所有内容。例: 我注册了用户“ B”,然后又包含了用户“ B”,但是,如果我删除了它,它会立即删除两者。我该如何纠正?
def incluir(self):
if self.validation():
query = 'INSERT INTO usuarios_arduino VALUES (NULL, ?,?)'
chave = Fernet.generate_key()
f = Fernet(chave)
f_pass = f.encrypt(self.senha.get().encode())
parameters = (self.user.get(), f_pass)
try:
self.run_query(query,parameters)
self.msg['text']='User {} included with success!'.format(self.user.get())
self.user.delete(0, END)
self.senha.delete(0, END)
except:
self.msg['text'] = 'User already exist, try other!'
pass
else:
self.msg['text'] = 'Please enter username and password in the fields!'