Skip to content
Snippets Groups Projects
Commit 32b7e2d7 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Bug fix

parent 72b0ca65
No related branches found
No related tags found
No related merge requests found
...@@ -290,8 +290,8 @@ class Absence(object): ...@@ -290,8 +290,8 @@ class Absence(object):
def create(self, db_obj): def create(self, db_obj):
self.filled = True self.filled = True
print(db_obj.ida) # print(db_obj.ida)
print(db_obj.typea) # print(db_obj.typea)
if db_obj.typea == 101: if db_obj.typea == 101:
self.type = TYPE_TEACHER self.type = TYPE_TEACHER
elif db_obj.typea == 100: elif db_obj.typea == 100:
...@@ -300,7 +300,7 @@ class Absence(object): ...@@ -300,7 +300,7 @@ class Absence(object):
self.type = TYPE_ROOM self.type = TYPE_ROOM
if self.type == TYPE_TEACHER: if self.type == TYPE_TEACHER:
print("IDA", db_obj.ida) # print("IDA", db_obj.ida)
self.teacher = get_teacher_by_id(db_obj.ida) self.teacher = get_teacher_by_id(db_obj.ida)
else: else:
self.room = get_room_by_id(db_obj.ida) self.room = get_room_by_id(db_obj.ida)
......
...@@ -53,7 +53,7 @@ class Event(object): ...@@ -53,7 +53,7 @@ class Event(object):
self.rooms.append(obj) self.rooms.append(obj)
if element[4] != "0" and element[4] != "": if element[4] != "0" and element[4] != "":
print(element[4]) # print(element[4])
try: try:
absence_id = int(element[4]) absence_id = int(element[4])
absence = get_absence_by_id(absence_id) absence = get_absence_by_id(absence_id)
......
...@@ -331,6 +331,10 @@ def get_substitutions_by_date_as_dict(date): ...@@ -331,6 +331,10 @@ def get_substitutions_by_date_as_dict(date):
for i, sub_raw in enumerate(subs_raw): for i, sub_raw in enumerate(subs_raw):
if sub_raw.lesson_id not in subs.keys(): if sub_raw.lesson_id not in subs.keys():
subs[sub_raw.lesson_id] = [] subs[sub_raw.lesson_id] = []
subs[sub_raw.lesson_id].append({"sub": sub_raw, "table": sub_table[i]}) sub_row = None
for sub_item in sub_table:
if sub_item.sub.id == sub_raw.id:
sub_row = sub_item
subs[sub_raw.lesson_id].append({"sub": sub_raw, "table": sub_row})
return subs return subs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment