Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SMASCH
scheduling-system
Commits
3806c55a
Commit
3806c55a
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
manual cherry pick of the fix for the appointmentType 'other' issue
parent
bbea6d17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!208
Update/merge 12 into 13
,
!207
Merge Devel 0.12.x into Master (0.13.x)
,
!202
Bug/fix requirements and code for tests to pass
Pipeline
#7807
passed
6 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/management/commands/holidays.py
+2
-4
2 additions, 4 deletions
smash/web/management/commands/holidays.py
with
2 additions
and
4 deletions
smash/web/management/commands/holidays.py
+
2
−
4
View file @
3806c55a
...
...
@@ -4,9 +4,6 @@ from django.core.management.base import BaseCommand
from
...models
import
Appointment
,
Location
,
AppointmentType
,
AppointmentTypeLink
appointment_type_other
=
AppointmentType
.
objects
.
filter
(
code
=
'
OTHER
'
).
first
()
def
get_easter_monday
(
easter_sunday
):
return
next_weekday
(
easter_sunday
,
0
)
...
...
@@ -64,6 +61,7 @@ class Command(BaseCommand):
holiday
.
comment
=
comment
holiday
.
visit_id
=
None
holiday
.
save
()
appointment_type_other
=
AppointmentType
.
objects
.
get_or_create
(
code
=
'
OTHER
'
,
defaults
=
{
default_duration
:
60
})
link
=
AppointmentTypeLink
(
appointment
=
holiday
,
appointment_type
=
appointment_type_other
)
link
.
save
()
...
...
@@ -92,4 +90,4 @@ def next_weekday(day_datetime, week_day):
days_ahead
=
week_day
-
day_datetime
.
weekday
()
if
days_ahead
<=
0
:
days_ahead
+=
7
return
day_datetime
+
datetime
.
timedelta
(
days_ahead
)
return
day_datetime
+
datetime
.
timedelta
(
days_ahead
)
\ No newline at end of file
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