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
Commits
3cc3bb63
"git@gitlab.fachschaften.org:felix_bonn/akplanning.git" did not exist on "11d84b162492a5339dd50eac3aa6a30deef580b7"
Commit
3cc3bb63
authored
1 month ago
by
Nadja Geisler
Browse files
Options
Downloads
Patches
Plain Diff
fix args
parent
6e1b8435
Branches
Branches containing commit
No related tags found
1 merge request
!250
Version upgrades
Pipeline
#275539
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AKModel/models.py
+7
-5
7 additions, 5 deletions
AKModel/models.py
with
7 additions
and
5 deletions
AKModel/models.py
+
7
−
5
View file @
3cc3bb63
...
@@ -503,7 +503,7 @@ class AK(models.Model):
...
@@ -503,7 +503,7 @@ class AK(models.Model):
return
reverse_lazy
(
'
submit:ak_detail
'
,
kwargs
=
{
'
event_slug
'
:
self
.
event
.
slug
,
'
pk
'
:
self
.
id
})
return
reverse_lazy
(
'
submit:ak_detail
'
,
kwargs
=
{
'
event_slug
'
:
self
.
event
.
slug
,
'
pk
'
:
self
.
id
})
return
self
.
edit_url
return
self
.
edit_url
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
def
save
(
self
,
*
args
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
# Auto-Generate Link if not set yet
# Auto-Generate Link if not set yet
if
self
.
link
==
""
:
if
self
.
link
==
""
:
link
=
self
.
event
.
base_url
+
self
.
name
.
replace
(
"
"
,
"
_
"
)
link
=
self
.
event
.
base_url
+
self
.
name
.
replace
(
"
"
,
"
_
"
)
...
@@ -512,7 +512,8 @@ class AK(models.Model):
...
@@ -512,7 +512,8 @@ class AK(models.Model):
# Tell Django that we have updated the link field
# Tell Django that we have updated the link field
if
update_fields
is
not
None
:
if
update_fields
is
not
None
:
update_fields
=
{
"
link
"
}.
union
(
update_fields
)
update_fields
=
{
"
link
"
}.
union
(
update_fields
)
super
().
save
(
force_insert
=
force_insert
,
force_update
=
force_update
,
using
=
using
,
update_fields
=
update_fields
)
super
().
save
(
*
args
,
force_insert
=
force_insert
,
force_update
=
force_update
,
using
=
using
,
update_fields
=
update_fields
)
class
Room
(
models
.
Model
):
class
Room
(
models
.
Model
):
...
@@ -629,7 +630,7 @@ class AKSlot(models.Model):
...
@@ -629,7 +630,7 @@ class AKSlot(models.Model):
def
overlaps
(
self
,
other
:
"
AKSlot
"
):
def
overlaps
(
self
,
other
:
"
AKSlot
"
):
"""
"""
Check wether two slots overlap
Check w
h
ether two slots overlap
:param other: second slot to compare with
:param other: second slot to compare with
:return: true if they overlap, false if not:
:return: true if they overlap, false if not:
...
@@ -637,13 +638,14 @@ class AKSlot(models.Model):
...
@@ -637,13 +638,14 @@ class AKSlot(models.Model):
"""
"""
return
self
.
start
<
other
.
end
<=
self
.
end
or
self
.
start
<=
other
.
start
<
self
.
end
return
self
.
start
<
other
.
end
<=
self
.
end
or
self
.
start
<=
other
.
start
<
self
.
end
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
def
save
(
self
,
*
args
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
# Make sure duration is not longer than the event
# Make sure duration is not longer than the event
if
update_fields
is
None
or
'
duration
'
in
update_fields
:
if
update_fields
is
None
or
'
duration
'
in
update_fields
:
event_duration
=
self
.
event
.
end
-
self
.
event
.
start
event_duration
=
self
.
event
.
end
-
self
.
event
.
start
event_duration_hours
=
event_duration
.
days
*
24
+
event_duration
.
seconds
//
3600
event_duration_hours
=
event_duration
.
days
*
24
+
event_duration
.
seconds
//
3600
self
.
duration
=
min
(
self
.
duration
,
event_duration_hours
)
self
.
duration
=
min
(
self
.
duration
,
event_duration_hours
)
super
().
save
(
force_insert
=
force_insert
,
force_update
=
force_update
,
using
=
using
,
update_fields
=
update_fields
)
super
().
save
(
*
args
,
force_insert
=
force_insert
,
force_update
=
force_update
,
using
=
using
,
update_fields
=
update_fields
)
class
AKOrgaMessage
(
models
.
Model
):
class
AKOrgaMessage
(
models
.
Model
):
...
...
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