Skip to content

Commit f053429

Browse files
authored
Merge pull request #26 from JoelEager/cli-bug-fixes
Code cleanup and bug fixes for the CLI
2 parents 5e63cbd + 8f44555 commit f053429

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packet/commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def sync_freshmen(freshmen_csv):
7070
# Add any new onfloor freshmen
7171
# pylint: disable=cell-var-from-loop
7272
current_fresh_sigs = set(map(lambda fresh_sig: fresh_sig.freshman_username, packet.fresh_signatures))
73-
for csv_freshman in filter(lambda csv_freshman: csv_freshman.rit_username not in current_fresh_sigs,
74-
freshmen_in_csv.values()):
73+
for csv_freshman in filter(lambda csv_freshman: csv_freshman.rit_username not in current_fresh_sigs and
74+
csv_freshman.onfloor, freshmen_in_csv.values()):
7575
db.session.add(FreshSignature(packet=packet, freshman=freshmen_in_db[csv_freshman.rit_username]))
7676

7777
db.session.commit()
@@ -105,8 +105,9 @@ def create_packets(freshmen_csv):
105105
all_upper = eboard.union(onfloor)
106106

107107
# Create the new packets and the signatures for each freshman in the given CSV
108+
freshmen_in_csv = parse_csv(freshmen_csv)
108109
print("Creating DB entries...")
109-
for freshman in Freshman.query.filter(Freshman.rit_username.in_(parse_csv(freshmen_csv))).all():
110+
for freshman in Freshman.query.filter(Freshman.rit_username.in_(freshmen_in_csv)).all():
110111
packet = Packet(freshman=freshman, start=start, end=end)
111112
db.session.add(packet)
112113

0 commit comments

Comments
 (0)