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
47755392
Verified
Commit
47755392
authored
3 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix deletion of events, don't delete all events
parent
cb3e3ee0
No related branches found
No related tags found
1 merge request
!190
Resolve "Events are deleted without reason"
Pipeline
#193817
failed
3 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/untis/util/mysql/importers/events.py
+11
-11
11 additions, 11 deletions
aleksis/apps/untis/util/mysql/importers/events.py
with
11 additions
and
11 deletions
aleksis/apps/untis/util/mysql/importers/events.py
+
11
−
11
View file @
47755392
...
...
@@ -127,14 +127,14 @@ def import_events(
existing_events
.
append
(
import_ref
)
ref
[
import_ref
]
=
new_event
# Delete all no longer existing events
for
e
in
LessonEvent
.
objects
.
filter
(
extended_data__event_untis__isnull
=
False
,
datetime_start__lte
=
validity_range
.
date_end
,
datetime_end__gte
=
validity_range
.
date_start
,
):
if
e
.
extended_data
[
"
event_untis
"
]
not
in
existing_events
:
logger
.
info
(
f
"
Event
{
e
.
id
}
deleted
"
)
with
create_revision
():
set_comment
(
_
(
"
Deleted by Untis import
"
))
e
.
delete
()
# Delete all no longer existing events
for
e
in
LessonEvent
.
objects
.
filter
(
extended_data__event_untis__isnull
=
False
,
datetime_start__
date__
lte
=
validity_range
.
date_end
,
datetime_end__
date__
gte
=
validity_range
.
date_start
,
):
if
e
.
extended_data
[
"
event_untis
"
]
not
in
existing_events
:
logger
.
info
(
f
"
Event
{
e
.
id
}
deleted
"
)
with
create_revision
():
set_comment
(
_
(
"
Deleted by Untis import
"
))
e
.
delete
()
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