Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Michael William Coughlin
GraceDB Server
Commits
3a837727
Commit
3a837727
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adding comments
parent
87dc217d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gracedb/superevents/utils.py
+6
-0
6 additions, 0 deletions
gracedb/superevents/utils.py
gracedb/superevents/views.py
+4
-0
4 additions, 0 deletions
gracedb/superevents/views.py
with
10 additions
and
0 deletions
gracedb/superevents/utils.py
+
6
−
0
View file @
3a837727
...
...
@@ -10,6 +10,9 @@ import os
import
logging
logger
=
logging
.
getLogger
(
__name__
)
# NOTE: everything in here assumes that permissions have already been checked
# and handled properly
# TODO:
# Add decorator to check access permissions (??) not sure if we should do it here or in the viewset itself
def
create_superevent
(
submitter
,
t_start
,
t_0
,
t_end
,
preferred_event
,
...
...
@@ -364,6 +367,8 @@ def get_or_create_tag(tag_name, display_name=None):
def
get_or_create_tags
(
tag_name_list
,
display_name_list
=
[]):
# TODO: make this a useful error
if
display_name_list
and
(
len
(
display_name_list
)
!=
len
(
tag_name_list
)):
raise
ValueError
(
''
)
...
...
@@ -379,6 +384,7 @@ def get_or_create_tags(tag_name_list, display_name_list=[]):
# TODO: add permissions checking?
# TODO: move this somewhere else?
def
get_superevent_by_date_id_or_404
(
request
,
superevent_id
):
filter_kwargs
=
Superevent
.
get_filter_kwargs_for_date_id_lookup
(
...
...
This diff is collapsed.
Click to expand it.
gracedb/superevents/views.py
+
4
−
0
View file @
3a837727
...
...
@@ -21,6 +21,9 @@ logger = logging.getLogger(__name__)
# Need to restrict ability to view
def
webview
(
request
,
superevent_id
):
# TODO: any special web displays for template for confirmed GWs?
# can do this in template by checking superevent.is_gw
# Get superevent object
superevent
=
get_superevent_by_date_id_or_404
(
request
,
superevent_id
)
...
...
@@ -186,6 +189,7 @@ def file_list(request, superevent_id):
}
return
render
(
request
,
'
superevents/file_list.html
'
,
context
=
context
)
# TODO:
# add permission checking
def
file_download
(
request
,
superevent_id
,
filename
):
...
...
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