Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
9b43cd66
Verified
Commit
9b43cd66
authored
1 year ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove remaining references to show Timeslot
parent
34974d83
No related branches found
No related tags found
No related merge requests found
Pipeline
#6651
passed
1 year ago
Stage: build
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/services.py
+12
-26
12 additions, 26 deletions
program/services.py
with
12 additions
and
26 deletions
program/services.py
+
12
−
26
View file @
9b43cd66
...
@@ -147,9 +147,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -147,9 +147,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# If no solution necessary: Create the projected timeslot and skip
# If no solution necessary: Create the projected timeslot and skip
if
"
solution_choices
"
not
in
timeslot
or
len
(
timeslot
[
"
collisions
"
])
==
0
:
if
"
solution_choices
"
not
in
timeslot
or
len
(
timeslot
[
"
collisions
"
])
==
0
:
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
)
)
continue
continue
...
@@ -182,9 +180,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -182,9 +180,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# - Create the projected timeslot
# - Create the projected timeslot
# - Delete the existing collision(s)
# - Delete the existing collision(s)
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
)
)
# Delete collision(s)
# Delete collision(s)
...
@@ -198,18 +194,14 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -198,18 +194,14 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# - Keep the existing timeslot
# - Keep the existing timeslot
# - Create projected with end of existing start
# - Create projected with end of existing start
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
existing
[
"
start
"
],
new_schedule
),
timeslot
[
"
start
"
],
existing
[
"
start
"
],
new_schedule
,
show
),
)
)
if
solution
==
"
ours-end
"
:
if
solution
==
"
ours-end
"
:
# - Create the projected timeslot
# - Create the projected timeslot
# - Change the start of the existing collision to projected end
# - Change the start of the existing collision to projected end
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
)
)
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
...
@@ -220,16 +212,14 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -220,16 +212,14 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# - Keep existing
# - Keep existing
# - Create projected with start time of existing end
# - Create projected with start time of existing end
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
existing
[
"
end
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
TimeSlot
.
objects
.
instantiate
(
existing
[
"
end
"
],
timeslot
[
"
end
"
],
new_schedule
),
)
)
if
solution
==
"
ours-start
"
:
if
solution
==
"
ours-start
"
:
# - Create the projected timeslot
# - Create the projected timeslot
# - Change end of existing to projected start
# - Change end of existing to projected start
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
)
)
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
...
@@ -240,13 +230,11 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -240,13 +230,11 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# - Keep existing
# - Keep existing
# - Create two projected timeslots with end of existing start and start of existing end
# - Create two projected timeslots with end of existing start and start of existing end
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
existing
[
"
start
"
],
new_schedule
),
timeslot
[
"
start
"
],
existing
[
"
start
"
],
new_schedule
,
show
),
)
)
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
existing
[
"
end
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
TimeSlot
.
objects
.
instantiate
(
existing
[
"
end
"
],
timeslot
[
"
end
"
],
new_schedule
),
)
)
if
solution
==
"
ours-both
"
:
if
solution
==
"
ours-both
"
:
...
@@ -255,9 +243,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -255,9 +243,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
# - Set existing end time to projected start
# - Set existing end time to projected start
# - Create another one with start = projected end and end = existing end
# - Create another one with start = projected end and end = existing end
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
),
timeslot
[
"
start
"
],
timeslot
[
"
end
"
],
new_schedule
,
show
),
)
)
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
existing_ts
=
TimeSlot
.
objects
.
get
(
pk
=
existing
[
"
timeslot_id
"
])
...
@@ -265,7 +251,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
...
@@ -265,7 +251,7 @@ def resolve_conflicts(data: ScheduleCreateUpdateData, schedule_pk: int | None, s
to_update
.
append
(
existing_ts
)
to_update
.
append
(
existing_ts
)
to_create
.
append
(
to_create
.
append
(
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
end
"
],
existing
[
"
end
"
],
new_schedule
,
show
),
TimeSlot
.
objects
.
instantiate
(
timeslot
[
"
end
"
],
existing
[
"
end
"
],
new_schedule
),
)
)
# If there were any errors, don't make any db changes yet
# If there were any errors, don't make any db changes yet
...
@@ -641,8 +627,8 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
...
@@ -641,8 +627,8 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
"
start
"
:
str
(
c
.
start
),
"
start
"
:
str
(
c
.
start
),
"
end
"
:
str
(
c
.
end
),
"
end
"
:
str
(
c
.
end
),
"
playlist_id
"
:
c
.
playlist_id
,
"
playlist_id
"
:
c
.
playlist_id
,
"
show_id
"
:
c
.
show
.
id
,
"
show_id
"
:
c
.
schedule
.
show
.
id
,
"
show_name
"
:
c
.
show
.
name
,
"
show_name
"
:
c
.
schedule
.
show
.
name
,
"
schedule_id
"
:
c
.
schedule_id
,
"
schedule_id
"
:
c
.
schedule_id
,
"
memo
"
:
c
.
memo
,
"
memo
"
:
c
.
memo
,
}
}
...
...
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