forked from orson/bachemap
fixed uuid/qr gen
This commit is contained in:
parent
24a11fc433
commit
65c0d401cb
7
app.py
7
app.py
@ -199,16 +199,17 @@ def create_app(config=Config):
|
|||||||
def dashboard():
|
def dashboard():
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
if not current_user.is_authenticated:
|
if not current_user.is_authenticated:
|
||||||
q_filter = "{'_id': ObjectId(current_user.id)}"
|
|
||||||
q_op = "{'$set': {'referral_code':str(uuid4())}}"
|
|
||||||
mongo.db.users.update_one(q_filter, q_op)
|
|
||||||
return redirect(url_for('thelogin'))
|
return redirect(url_for('thelogin'))
|
||||||
if not current_user.is_admin:
|
if not current_user.is_admin:
|
||||||
pins = list(mongo.db.pins.find({"added_by": current_user.id}))
|
pins = list(mongo.db.pins.find({"added_by": current_user.id}))
|
||||||
|
qr_update = mongo.db.users.update_one({'_id': ObjectId(current_user.id)}, {'$set': {'referral_code': str(uuid4())}})
|
||||||
|
print(qr_update)
|
||||||
return render_template('dashboard.html', pins=pins)
|
return render_template('dashboard.html', pins=pins)
|
||||||
if current_user.is_admin:
|
if current_user.is_admin:
|
||||||
users = list(mongo.db.users.find())
|
users = list(mongo.db.users.find())
|
||||||
pins = list(mongo.db.pins.find())
|
pins = list(mongo.db.pins.find())
|
||||||
|
qr_update = mongo.db.users.update_one({'_id': ObjectId(current_user.id)}, {'$set': {'referral_code': str(uuid4())}})
|
||||||
|
print(qr_update)
|
||||||
return render_template('dashboard.html', users=users, pins=pins)
|
return render_template('dashboard.html', users=users, pins=pins)
|
||||||
#if request.method == 'POST':
|
#if request.method == 'POST':
|
||||||
# pass
|
# pass
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user