Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
KIF
AKPlanning
Merge requests
!124
Default availability for new AKs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Default availability for new AKs
features-availabilities
into
main
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Benjamin Hättasch
requested to merge
features-availabilities
into
main
2 years ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
Automatically create availability when user doesn't specify them during submission
Edited
2 years ago
by
Benjamin Hättasch
0
0
Merge request reports
Compare
main
version 1
3364e2ba
2 years ago
main (base)
and
latest version
latest version
a2cb5722
1 commit,
2 years ago
version 1
3364e2ba
7 commits,
2 years ago
2 files
+
17
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
AKModel/availability/models.py
+
9
−
0
Options
@@ -235,6 +235,15 @@ class Availability(models.Model):
def
simplified
(
self
):
return
f
'
{
self
.
start
.
astimezone
(
self
.
event
.
timezone
).
strftime
(
"
%a %H
:
%
M
"
)
}
-
{
self
.
end
.
astimezone
(
self
.
event
.
timezone
).
strftime
(
"
%a %H
:
%
M
"
)
}
'
@classmethod
def
with_event_length
(
cls
,
event
,
person
=
None
,
room
=
None
,
ak
=
None
,
ak_category
=
None
):
timeframe_start
=
event
.
start
# adapt to our event model
# add 1 day, not 24 hours, https://stackoverflow.com/a/25427822/2486196
timeframe_end
=
event
.
end
# adapt to our event model
timeframe_end
=
timeframe_end
+
datetime
.
timedelta
(
days
=
1
)
return
Availability
(
start
=
timeframe_start
,
end
=
timeframe_end
,
event
=
event
,
person
=
person
,
room
=
room
,
ak
=
ak
,
ak_category
=
ak_category
)
class
Meta
:
verbose_name
=
_
(
'
Availability
'
)
verbose_name_plural
=
_
(
'
Availabilities
'
)
Loading