@@ -24,21 +24,18 @@ def sign(packet_id, info):
24
24
for sig in filter (lambda sig : sig .member == info ["uid" ], packet .upper_signatures ):
25
25
sig .signed = True
26
26
app .logger .info ("Member {} signed packet {} as an upperclassman" .format (info ["uid" ], packet_id ))
27
- packet_signed_notification (packet , info ["uid" ])
28
- return commit_sig (packet , was_100 )
27
+ return commit_sig (packet , was_100 , info ["uid" ])
29
28
30
29
# The CSHer is a misc so add a new row
31
30
db .session .add (MiscSignature (packet = packet , member = info ["uid" ]))
32
31
app .logger .info ("Member {} signed packet {} as a misc" .format (info ["uid" ], packet_id ))
33
- packet_signed_notification (packet , info ["uid" ])
34
- return commit_sig (packet , was_100 )
32
+ return commit_sig (packet , was_100 , info ["uid" ])
35
33
else :
36
34
# Check if the freshman is onfloor and if so, sign that row
37
35
for sig in filter (lambda sig : sig .freshman_username == info ["uid" ], packet .fresh_signatures ):
38
36
sig .signed = True
39
37
app .logger .info ("Freshman {} signed packet {}" .format (info ["uid" ], packet_id ))
40
- packet_signed_notification (packet , info ["uid" ])
41
- return commit_sig (packet , was_100 )
38
+ return commit_sig (packet , was_100 , info ["uid" ])
42
39
43
40
app .logger .warn ("Failed to add {}'s signature to packet {}" .format (info ["uid" ], packet_id ))
44
41
return "Error: Signature not valid. Reason: Unknown"
@@ -67,7 +64,8 @@ def report(info):
67
64
return "Success: " + get_rit_name (info ['uid' ]) + " sent a report"
68
65
69
66
70
- def commit_sig (packet , was_100 ):
67
+ def commit_sig (packet , was_100 , uid ):
68
+ packet_signed_notification (packet , uid )
71
69
db .session .commit ()
72
70
if not was_100 and packet .is_100 ():
73
71
packet_100_percent_notification (packet )
0 commit comments