Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Untis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Untis
Commits
7977f840
Commit
7977f840
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix
parent
9f9d5a47
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/untis/parse.py
+13
-13
13 additions, 13 deletions
biscuit/apps/untis/parse.py
biscuit/apps/untis/sub.py
+6
-1
6 additions, 1 deletion
biscuit/apps/untis/sub.py
with
19 additions
and
14 deletions
biscuit/apps/untis/parse.py
+
13
−
13
View file @
7977f840
...
...
@@ -172,25 +172,25 @@ def get_lesson_element_by_id_and_teacher(lesson_id, teacher, hour=None, weekday=
return
None
,
None
el
=
None
i
=
0
# print(lesson.elements)
for
i
,
element
in
enumerate
(
lesson
.
elements
):
# print(element.teacher.shortcode)
if
element
.
teacher
.
id
==
teacher
.
id
:
el
=
element
break
if
teacher
is
not
None
:
for
i
,
element
in
enumerate
(
lesson
.
elements
):
if
element
.
teacher
is
not
None
:
if
element
.
teacher
.
id
==
teacher
.
id
:
el
=
element
break
elif
len
(
lesson
.
elements
)
>
0
:
el
=
lesson
.
elements
[
0
]
else
:
el
=
None
t
=
None
# print(lesson.times)
# print(weekday)
# print(hour)
for
time
in
lesson
.
times
:
# print("DAY", time.day, time.hour)
if
time
.
day
==
weekday
and
time
.
hour
==
hour
:
t
=
time
# print(t)
room
=
None
if
t
is
not
None
and
len
(
t
.
rooms
)
>
i
:
# print(t.rooms)
# print(len(t.rooms))
room
=
t
.
rooms
[
i
]
if
el
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/untis/sub.py
+
6
−
1
View file @
7977f840
...
...
@@ -65,6 +65,7 @@ class Substitution(object):
if
db_obj
.
teacher_idlessn
!=
0
:
self
.
teacher_old
=
drive
[
"
teachers
"
][
db_obj
.
teacher_idlessn
]
# print(self.teacher_new, self.teacher_old, self.lesson_id, self.id)
if
db_obj
.
teacher_idsubst
!=
0
:
self
.
teacher_new
=
drive
[
"
teachers
"
][
db_obj
.
teacher_idsubst
]
...
...
@@ -75,6 +76,8 @@ class Substitution(object):
self
.
teacher_old
=
self
.
teacher_new
self
.
teacher_new
=
None
print
(
self
.
teacher_old
,
self
.
teacher_new
)
self
.
lesson_element
,
self
.
room_old
=
get_lesson_element_by_id_and_teacher
(
self
.
lesson_id
,
self
.
teacher_old
,
self
.
lesson
,
self
.
date
.
weekday
()
+
1
)
# print(self.lesson)
...
...
@@ -149,7 +152,9 @@ class SubRow(object):
def
generate_teacher_row
(
sub
,
full
=
False
):
# print(sub.id)
teacher
=
""
if
sub
.
type
==
1
:
if
not
sub
.
teacher_old
and
not
sub
.
teacher_new
:
teacher
=
""
elif
sub
.
type
==
1
:
teacher
=
"
<s>{}</s>
"
.
format
(
sub
.
teacher_old
.
shortcode
if
not
full
else
sub
.
teacher_old
.
name
)
elif
sub
.
teacher_new
and
sub
.
teacher_old
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment