First look

This commit is contained in:
florianuhlig
2025-10-02 23:36:57 +02:00
parent 8c8856fc07
commit 4f663eb8a5
8 changed files with 75 additions and 3 deletions

19
sqlLite/set.py Normal file
View File

@@ -0,0 +1,19 @@
from hashlib import sha512
import sqlite3
import useful.check as check
from . import db_name
def set_password_hash(password):
return sha512(password.encode('utf-8')).hexdigest()
def set_login(email, password):
db_con = sqlite3.connect(db_name)
db_cur = db_con.cursor()
try:
if check.check_email(email):
db_cur.execute("INSERT INTO T_USERS (USERNAME, EMAIL, PASSWORD) VALUES (?,?,?)", ('test',email, set_password_hash(password)))
db_con.commit()
else:
print("Email entered is not valid")
except sqlite3.IntegrityError:
print("Username or Email entered is not unique")