forked from orson/bachemap
non-working uuid changer line 204
This commit is contained in:
parent
02841fcc2e
commit
24a11fc433
3
app.py
3
app.py
@ -199,6 +199,9 @@ def create_app(config=Config):
|
||||
def dashboard():
|
||||
if request.method == 'GET':
|
||||
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'))
|
||||
if not current_user.is_admin:
|
||||
pins = list(mongo.db.pins.find({"added_by": current_user.id}))
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
{% extends 'secondbase.html' %}
|
||||
{% block content %}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.js"></script>
|
||||
|
||||
<style>
|
||||
main {
|
||||
overflow-y: scroll;
|
||||
@ -7,8 +9,21 @@
|
||||
</style>
|
||||
<div style="padding-top: 30px;">
|
||||
<h3>Hola <span style="color: darkgreen;">{{current_user.username}}</span></h3>
|
||||
<h4>Tu link de invitación es:</h4>
|
||||
<h4>https://baches.qro.mx/registrame/{{current_user.referral_code}}</h4>
|
||||
<p>Aquí puedes ver los pines que has agregado y ver tu enlace/QR de invitación. Cada vez que recargas esta página, tu enlace de invitacón cambia y el anterior se vuelve inválido.</p>
|
||||
<div id="qrgen" style="border-width:5px; border-color:#e6e6fa">
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var qrcode = new QRCode(document.getElementById("qrgen"), {
|
||||
text: "https://baches.qro.mx/registrame/{{current_user.referral_code}}",
|
||||
width: 128,
|
||||
height: 128,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#e6e6fa",
|
||||
correctLevel : QRCode.CorrectLevel.L
|
||||
});
|
||||
</script>
|
||||
<h3>Tu link es:</h3>
|
||||
<h2>https://baches.qro.mx/registrame/{{current_user.referral_code}}</h2>
|
||||
|
||||
{% if pins %}
|
||||
{% for pin in pins %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user