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
ce207a54
Commit
ce207a54
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix for absences (not only for teachers possible)
parent
f4e61e9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
biscuit/apps/untis/api.py
+14
-2
14 additions, 2 deletions
biscuit/apps/untis/api.py
biscuit/apps/untis/plan.py
+1
-5
1 addition, 5 deletions
biscuit/apps/untis/plan.py
biscuit/apps/untis/sub.py
+5
-2
5 additions, 2 deletions
biscuit/apps/untis/sub.py
with
20 additions
and
9 deletions
biscuit/apps/untis/api.py
+
14
−
2
View file @
ce207a54
...
...
@@ -4,6 +4,10 @@ from untisconnect.api_helper import get_term_by_id, run_using, untis_date_to_dat
from
.
import
models
from
timetable.settings
import
untis_settings
TYPE_TEACHER
=
0
TYPE_ROOM
=
1
TYPE_CLASS
=
2
def
run_all
(
obj
,
filter_term
=
True
):
return
run_default_filter
(
run_using
(
obj
).
all
(),
filter_term
=
filter_term
)
...
...
@@ -276,6 +280,8 @@ class Absence(object):
def
__init__
(
self
):
self
.
filled
=
None
self
.
teacher
=
None
self
.
room
=
None
self
.
type
=
TYPE_TEACHER
self
.
from_date
=
None
self
.
to_date
=
None
self
.
from_lesson
=
None
...
...
@@ -284,8 +290,14 @@ class Absence(object):
def
create
(
self
,
db_obj
):
self
.
filled
=
True
print
(
db_obj
.
ida
)
self
.
teacher
=
get_teacher_by_id
(
db_obj
.
ida
)
# print(db_obj.ida)
print
(
db_obj
.
typea
)
self
.
type
=
TYPE_TEACHER
if
db_obj
.
typea
!=
102
else
TYPE_ROOM
if
self
.
type
==
TYPE_TEACHER
:
self
.
teacher
=
get_teacher_by_id
(
db_obj
.
ida
)
else
:
self
.
room
=
get_room_by_id
(
db_obj
.
ida
)
self
.
from_date
=
untis_date_to_date
(
db_obj
.
datefrom
)
self
.
to_date
=
untis_date_to_date
(
db_obj
.
dateto
)
self
.
from_lesson
=
db_obj
.
lessonfrom
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/untis/plan.py
+
1
−
5
View file @
ce207a54
...
...
@@ -4,14 +4,10 @@ from django.utils import timezone
from
schoolapps
import
settings
from
schoolapps.settings
import
LESSONS
from
untisconnect.api
import
format_classes
from
untisconnect.api
import
format_classes
,
TYPE_CLASS
,
TYPE_TEACHER
,
TYPE_ROOM
from
untisconnect.parse
import
parse
from
untisconnect.sub
import
get_substitutions_by_date_as_dict
,
TYPE_CANCELLATION
TYPE_TEACHER
=
0
TYPE_ROOM
=
1
TYPE_CLASS
=
2
class
LessonContainer
(
object
):
"""
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/untis/sub.py
+
5
−
2
View file @
ce207a54
from
django.utils
import
timezone
from
untisconnect
import
models
from
untisconnect.api
import
run_default_filter
,
row_by_row_helper
,
format_classes
,
get_all_absences_by_date
from
untisconnect.api
import
run_default_filter
,
row_by_row_helper
,
format_classes
,
get_all_absences_by_date
,
\
TYPE_TEACHER
from
untisconnect.api_helper
import
run_using
,
untis_split_first
,
untis_date_to_date
,
date_to_untis_date
from
untisconnect.parse
import
get_lesson_element_by_id_and_teacher
from
untisconnect.drive
import
build_drive
...
...
@@ -83,7 +84,7 @@ class Substitution(object):
self
.
teacher_old
=
self
.
teacher_new
self
.
teacher_new
=
None
print
(
self
.
teacher_old
,
self
.
teacher_new
)
#
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
)
...
...
@@ -275,6 +276,8 @@ def get_header_information(subs, date):
if
info
.
absences
:
elements
=
[]
for
absence
in
info
.
absences
:
if
absence
.
type
!=
TYPE_TEACHER
:
continue
if
absence
.
is_whole_day
:
# Teacher is missing the whole day
elements
.
append
(
"
{}
"
.
format
(
absence
.
teacher
.
shortcode
))
...
...
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