From 24a11fc4337dd76e6db170f72fa78a1b187e94a6 Mon Sep 17 00:00:00 2001 From: kprftw Date: Fri, 6 Sep 2024 00:07:52 -0600 Subject: [PATCH] non-working uuid changer line 204 --- app.py | 3 +++ templates/dashboard.html | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 69f3159..32d7e33 100644 --- a/app.py +++ b/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})) diff --git a/templates/dashboard.html b/templates/dashboard.html index e014756..6d43849 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,5 +1,7 @@ {% extends 'secondbase.html' %} {% block content %} + +

Hola {{current_user.username}}

-

Tu link de invitación es:

-

https://baches.qro.mx/registrame/{{current_user.referral_code}}

+

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.

+
+
+ +

Tu link es:

+

https://baches.qro.mx/registrame/{{current_user.referral_code}}

{% if pins %} {% for pin in pins %}