|
|
|
@ -15,13 +15,13 @@ def get_matches(user_id):
|
|
|
|
|
|
|
|
|
|
#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()
|
|
|
|
|
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 == []:
|
|
|
|
|
return list_of_matches
|
|
|
|
|
|
|
|
|
|
# see who else voted yes
|
|
|
|
|
for c in all_shared_of_user_of_ir_1:
|
|
|
|
|
others_yes = all_cards.filter(Card.share_id == c.share_id, Card.interest_rate == 1).all()
|
|
|
|
|
others_yes = all_cards.filter(Card.share_id == c.share_id, Card.interest_rate == "1", Card.owner_id != user_id).all()
|
|
|
|
|
if others_yes == []:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|