Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
whats-open
Commits
33c856e2
Commit
33c856e2
authored
Feb 22, 2018
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
whats-open/api/admin.py
whats-open/api/admin.py
+8
-0
No files found.
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