Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open
Commits
33c856e2
Commit
33c856e2
authored
Feb 22, 2018
by
Daniel W Bond
Browse files
the owner of a new facility defaults to the user creating the facility
parent
ec5b0b71
Pipeline
#2143
passed with stage
in 1 minute and 28 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
whats-open/api/admin.py
View file @
33c856e2
...
...
@@ -34,6 +34,14 @@ class FacilityAdmin(admin.ModelAdmin):
}),
)
# despite the name of this method, ("change" seems to imply it would affect modify)
# it is called only when initially creating a model
def
get_changeform_initial_data
(
self
,
request
):
initial_data
=
super
(
FacilityAdmin
,
self
).
get_changeform_initial_data
(
request
)
initial_data
[
'owners'
]
=
[
request
.
user
,
]
return
initial_data
class
OpenTimeInline
(
admin
.
TabularInline
):
"""
A table of time periods that represent an "open time" for a Facility.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment