Skip to content

Commit 0bf270a

Browse files
committed
Fixed did_sign algorithm
1 parent b7ba9f0 commit 0bf270a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packet/routes/shared.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ def packets(info=None):
3131
if app.config["REALM"] == "csh":
3232
# User is an upperclassman
3333
for packet in packets:
34-
for sig in chain(packet.upper_signatures, packet.misc_signatures):
35-
packet.did_sign = sig.member == info["uid"]
34+
for sig in filter(lambda sig: sig.member == info["uid"], chain(packet.upper_signatures,
35+
packet.misc_signatures)):
36+
packet.did_sign = sig.signed
3637
else:
3738
# User is a freshman
3839
for packet in packets:
39-
for sig in packet.fresh_signatures:
40-
packet.did_sign = sig.freshman_username == info["uid"]
40+
for sig in filter(lambda sig: sig.freshman_username == info["uid"], packet.fresh_signatures):
41+
packet.did_sign = sig.signed
4142

4243
return render_template("active_packets.html", info=info, packets=packets)

0 commit comments

Comments
 (0)