Skip to content

Commit 77366ca

Browse files
committed
Alright, it works now
1 parent 151d4b0 commit 77366ca

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packet/routes/shared.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,20 @@ 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.signed and sig.member == info["uid"]
34+
packet.did_sign = False
35+
36+
for sig in chain(filter(lambda sig: sig.signed, packet.upper_signatures), packet.misc_signatures):
37+
if sig.member == info["uid"]:
38+
packet.did_sign = True
39+
break
3640
else:
3741
# User is a freshman
3842
for packet in packets:
39-
for sig in packet.fresh_signatures:
40-
packet.did_sign = sig.signed and sig.freshman_username == info["uid"]
43+
packet.did_sign = False
44+
45+
for sig in filter(lambda sig: sig.signed, packet.fresh_signatures):
46+
if sig.member == info["uid"]:
47+
packet.did_sign = True
48+
break
4149

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

0 commit comments

Comments
 (0)