Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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-Alsijil
Merge requests
!435
Fix get_or_create for documentations to prevent double entries
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix get_or_create for documentations to prevent double entries
prevent-double-documentations
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Jonathan Weth
requested to merge
prevent-double-documentations
into
master
3 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
87d51c3a
1 commit,
3 months ago
1 file
+
3
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/apps/alsijil/models.py
+
3
−
4
Options
@@ -292,12 +292,11 @@ class Documentation(CalendarEvent):
lesson_event
.
teachers
,
)
obj
=
cls
.
objects
.
create
(
obj
,
__
=
cls
.
objects
.
get_or_
create
(
datetime_start
=
datetime_start
,
datetime_end
=
datetime_end
,
amends
=
lesson_event
,
course
=
course
,
subject
=
subject
,
defaults
=
dict
(
subject
=
subject
,
amends
=
lesson_event
),
)
obj
.
teachers
.
set
(
teachers
.
all
())
obj
.
save
()
@@ -308,7 +307,7 @@ class Documentation(CalendarEvent):
return
obj
@classmethod
def
get_or_create_by_id
(
cls
,
_id
:
str
|
int
,
user
):
def
get_or_create_by_id
(
cls
,
_id
:
str
,
user
):
if
_id
.
startswith
(
"
DUMMY
"
):
return
cls
.
create_from_lesson_event
(
user
,
Loading