From 1dd8d277a2cf42688856971ac2738e61587215f3 Mon Sep 17 00:00:00 2001 From: Kostanjevec Date: Thu, 23 Jun 2022 14:44:25 +0200 Subject: [PATCH] emails by id dictionary, still buggy tho --- matches.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/matches.py b/matches.py index ed6f08d..a203f24 100644 --- a/matches.py +++ b/matches.py @@ -12,7 +12,7 @@ def get_matches(user_id): list_of_matches = [] - #in all shared cards for the ones you votes yes + #in all shared cards for the ones you voted yes all_cards = dbsession.query(Card) all_shared_of_user_of_ir_1 = all_cards.filter(Card.share_id != "0", Card.owner_id == user_id, Card.interest_rate == 1).all() if all_shared_of_user_of_ir_1 == []: @@ -49,9 +49,10 @@ def index(): users = dbsession.query(User) names_by_ids = {} - + emails_by_ids = {} + for id in user_ids: + names_by_ids[id] = users.get(id).username + emails_by_ids[id] = users.get(id).email - names_by_ids[id] = users.get(id).username - - return render_template("matches.html", username=username, list_of_matches=list_of_matches, names_by_ids=names_by_ids, users=users) + return render_template("matches.html", username=username, list_of_matches=list_of_matches, names_by_ids=names_by_ids, emails_by_ids=emails_by_ids, users=users)