Protected the load users
This commit is contained in:
+19
-15
@@ -144,25 +144,29 @@ def salary_verifypin():
|
|||||||
|
|
||||||
@app.route('/salary/demousers')
|
@app.route('/salary/demousers')
|
||||||
def salary_demousers():
|
def salary_demousers():
|
||||||
dList = []
|
|
||||||
|
|
||||||
|
try:
|
||||||
SELECT_DEMO_ENTRY = f"SELECT id,uid, bvn AS CustomerID, mobile AS AccountID, name,offers,salary_account,current_loans,mobile,bvn, email, pin, added::text, balance, updated::text AS updated FROM demo_bank_accounts ORDER BY id DESC LIMIT 1500"
|
SELECT_DEMO_ENTRY = f"SELECT id,uid, bvn AS CustomerID, mobile AS AccountID, name,offers,salary_account,current_loans,mobile,bvn, email, pin, added::text, balance, updated::text AS updated FROM demo_bank_accounts ORDER BY id DESC LIMIT 1500"
|
||||||
# print(SELECT_DEMO_ENTRY)
|
print(SELECT_DEMO_ENTRY)
|
||||||
with connection:
|
with connection:
|
||||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||||
cursor.execute(SELECT_DEMO_ENTRY)
|
cursor.execute(SELECT_DEMO_ENTRY)
|
||||||
select_demoS = cursor.fetchall()
|
select_demoS = cursor.fetchall()
|
||||||
# "last_update": datetime.datetime.utcnow(),#
|
# "last_update": datetime.datetime.utcnow(),#
|
||||||
demo_data = json.dumps( [dict(ix) for ix in select_demoS] )
|
demo_data = json.dumps([dict(ix) for ix in select_demoS])
|
||||||
result_demo_data = {
|
result_demo_data = {
|
||||||
"last_update": "2010-01-01",
|
"last_update": "2010-01-01",
|
||||||
"offers":products(),
|
"offers": products(),
|
||||||
"list" : json.loads( demo_data)
|
"list": json.loads(demo_data)
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
"demo_data": result_demo_data,
|
"demo_data": result_demo_data,
|
||||||
}, 200
|
}, 200
|
||||||
|
except Exception as e:
|
||||||
|
return {
|
||||||
|
"demo_data": [],
|
||||||
|
}, 200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# VARCHAR(125),
|
# VARCHAR(125),
|
||||||
|
|||||||
Reference in New Issue
Block a user