db changes
This commit is contained in:
parent
6e04438014
commit
c285e8dc76
1 changed files with 7 additions and 9 deletions
16
db.py
16
db.py
|
|
@ -3,24 +3,22 @@
|
|||
import mysql.connector
|
||||
|
||||
# database settings
|
||||
DBUSER = "remoteAccess"
|
||||
DBPASSWORD = "remoteAccess2020"
|
||||
DBUSER = "gundersena"
|
||||
DBPASSWORD = "remoteaccess"
|
||||
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)
|
||||
cnx = mysql.connector.connect(user=DBUSER, password=DBPASSWORD, host=DBHOST, database="accounts")
|
||||
cursor = 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}';")
|
||||
query = f"SELECT * FROM accounts.accounts WHERE crimata_id='{crimata_id}';"
|
||||
|
||||
people_cursor.execute(query)
|
||||
cursor.execute(query)
|
||||
|
||||
verified = False
|
||||
for (_, crimata_id, _) in people_cursor:
|
||||
for (_, crimata_id, _) in cursor:
|
||||
verified = True
|
||||
|
||||
return verified
|
||||
Loading…
Reference in a new issue