Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
ed86ff7f
Commit
ed86ff7f
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix
parent
94ac2d80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!86
Merge school-apps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
schoolapps/untisconnect/parse.py
+13
-13
13 additions, 13 deletions
schoolapps/untisconnect/parse.py
schoolapps/untisconnect/sub.py
+6
-1
6 additions, 1 deletion
schoolapps/untisconnect/sub.py
with
19 additions
and
14 deletions
schoolapps/untisconnect/parse.py
+
13
−
13
View file @
ed86ff7f
...
...
@@ -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.
schoolapps/untisconnect/sub.py
+
6
−
1
View file @
ed86ff7f
...
...
@@ -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