added dash call
This commit is contained in:
@@ -5,6 +5,7 @@ from dotenv import load_dotenv
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
import psycopg2
|
||||
from psycopg2.extras import NamedTupleCursor
|
||||
import pandas as pd
|
||||
|
||||
load_dotenv()
|
||||
|
||||
@@ -25,10 +26,20 @@ class Members:
|
||||
|
||||
def get_member_by_uid(self, user_uid):
|
||||
"""Get a user by uid"""
|
||||
user = db.members.find_one({"uid": user_uid, "active": True})
|
||||
if not user:
|
||||
#user = db.members.find_one({"uid": user_uid, "active": True})
|
||||
GLOBAL_AVG = "SELECT username,email,account_name,firstname,lastname FROM members WHERE uid::text = '" + user_uid + "'"
|
||||
#print(GLOBAL_AVG)
|
||||
with db:
|
||||
with db.cursor() as cursor:
|
||||
cursor.execute(GLOBAL_AVG)
|
||||
account = cursor.fetchall()
|
||||
#return jsonify(hello="ameye world")
|
||||
# Convert to DataFrame
|
||||
df = pd.DataFrame(account, columns=[desc[0] for desc in db.description])
|
||||
print(df)
|
||||
if not account:
|
||||
return
|
||||
return user
|
||||
return account
|
||||
|
||||
|
||||
# def get_by_id(self, user_id):
|
||||
|
||||
Reference in New Issue
Block a user