db
This commit is contained in:
parent
db2e6c4f15
commit
f583352e42
10 changed files with 47 additions and 12 deletions
26
db.py
Normal file
26
db.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# db.py
|
||||
|
||||
import mysql.connector
|
||||
|
||||
# database settings
|
||||
DBUSER = "remoteAccess"
|
||||
DBPASSWORD = "remoteAccess2020"
|
||||
DBHOST = "75.86.178.105"
|
||||
|
||||
# People Schema
|
||||
# -------------
|
||||
|
||||
people_cnx = mysql.connector.connect(user=DBUSER, password=DBPASSWORD, host=DBHOST, database="People")
|
||||
people_cursor = people_cnx.cursor(buffered=True)
|
||||
|
||||
# Verify that an email is a valid crimata_id.
|
||||
def verify(crimata_id, get=False):
|
||||
query = (f"SELECT * FROM People.users WHERE crimata_id='{crimata_id}';")
|
||||
|
||||
people_cursor.execute(query)
|
||||
|
||||
verified = False
|
||||
for (_, crimata_id, _) in people_cursor:
|
||||
verified = True
|
||||
|
||||
return verified
|
||||
Loading…
Reference in a new issue