Skip to content

Commit

Permalink
Merge pull request #16 from filips123/fix-lunch-schedule-empty-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 authored Mar 19, 2021
2 parents 596e1b2 + 753f0a7 commit c1d4bed
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions API/gimvicurnik/updaters/eclassroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,19 @@ def _normalize_teacher_name(name):

# Special case: Teachers with multiple surnames
teachers = {
"Jereb": "Batagelj",
"Crnoja": "Legan",
"Erbežnik": "Mihelič",
"Gresl": "Černe",
"Tehovnik": "Glaser",
"Jereb": "Batagelj",
"Merhar": "Kariž",
"Erbežnik": "Mihelič",
"Zelič": "Ocvirk",
"Osole": "Pikl",
"Stjepić": "Šajn",
"Tehovnik": "Glaser",
"Vahtar": "Rudolf",
"Vičar": "Potočnik",
"Završnik": "Ražen",
"Vahtar": "Rudolf",
"Stjepić": "Šajn",
"Zelič": "Ocvirk",
"Žemva": "Strmčnik",
}
if name.split()[0] in teachers:
return teachers[name.split()[0]]
Expand Down Expand Up @@ -506,8 +508,9 @@ def _parse_daily_lunch_schedule(self, date, tables):
time = datetime.datetime.strptime(row[0].strip(), "%H:%M").time() if row[0] else last_hour
last_hour = time

notes = row[1] if row[1] else last_notes
last_notes = notes.strip()
notes = row[1].strip() if row[0] else last_notes
notes = notes if notes else None
last_notes = notes

class_ = row[2].strip()
location = row[4].strip()
Expand Down

0 comments on commit c1d4bed

Please sign in to comment.