From 17a15dd416f2e06ef949417ea9f663a97451721b Mon Sep 17 00:00:00 2001 From: Kostanjevec Date: Mon, 13 Jun 2022 14:51:13 +0200 Subject: [PATCH] cleanup --- share.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/share.py b/share.py index 5520ceb..d117380 100644 --- a/share.py +++ b/share.py @@ -15,13 +15,11 @@ def share(card, user_id): print(card.share_id, card.id) #tu bi lahko naredili nek autoincrement ampak i guess da hash unique idja tudi daje unique share_id, tega potem uporabljamo, da preverimo matche h = md5(str(card.id).encode("utf-8")).hexdigest() - print("hash: ", h) card.share_id = h # all users users = dbsession.query(User).filter(User.id != user_id).all() for user in users: - print("hey, ", user.id) #TODO skip če že ima ta card v db. new_card = card = Card(title=card.title, interest_rate=-1.0, owner_id=user.id, item_location=card.item_location, last_review=None, share_id=h) dbsession.add(new_card)