Skip to content

Commit 0b21ce7

Browse files
committed
remove unused check_teacher function
1 parent 0a44c96 commit 0b21ce7

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

checker.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pprint import pprint
55

66
from fet_api_to_gcal import db
7-
from fet_api_to_gcal.common.utils import getDate, perror, psuccess
7+
from fet_api_to_gcal.common.utils import getDate, perror, psuccess, path_leaf
88
from fet_api_to_gcal.models import Calendar, Resource, Std_mail, Teacher
99

1010

@@ -22,34 +22,6 @@
2222
}
2323

2424

25-
def check_teachers(teacher_file):
26-
"""Checks that all teachers from the FET timetable are present in the database
27-
28-
Args:
29-
teacher_file (str, required): path to a FET generated csv file for teachers.
30-
31-
Returns:
32-
dict: a dictionary with two keys, one for the operation status
33-
and one for missing teachers when status is False else returns None
34-
"""
35-
not_found = []
36-
37-
with open(teacher_file, "r") as teachers_f:
38-
teachers = teachers_f.readlines()
39-
total_teachers, i = len(teachers[1:]), 0
40-
for teacher_name in teachers[1:]:
41-
teacher_name = teacher_name.replace('"', '').strip()
42-
teacher_obj = Teacher.query.filter_by(
43-
fet_name=teacher_name).first()
44-
if teacher_obj is None:
45-
not_found.append(teacher_name)
46-
47-
if len(not_found) != 0:
48-
return {"status": False, "missing_teachers": not_found}
49-
else:
50-
return {"status": True, "missing_teachers": None}
51-
52-
5325
def check_timetable_validity(timetable_path,
5426
dates,
5527
events_freq=1,

0 commit comments

Comments
 (0)