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
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
09aeaedd
Commit
09aeaedd
authored
5 months ago
by
Alexander Pace
Browse files
Options
Downloads
Patches
Plain Diff
gracedb-2.28.2
parent
bdb1c5eb
No related branches found
No related tags found
1 merge request
!238
gracedb-2.28.2
Pipeline
#668933
passed
5 months ago
Stage: test
Stage: branch
Stage: latest
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/settings/base.py
+1
-1
1 addition, 1 deletion
config/settings/base.py
gracedb/api/v1/events/views.py
+24
-3
24 additions, 3 deletions
gracedb/api/v1/events/views.py
with
25 additions
and
4 deletions
config/settings/base.py
+
1
−
1
View file @
09aeaedd
...
...
@@ -48,7 +48,7 @@ INFO_BANNER_MESSAGE = "TEST MESSAGE"
BETA_REPORTS_LINK
=
False
# Version ---------------------------------------------------------------------
PROJECT_VERSION
=
'
2.28.
1
'
PROJECT_VERSION
=
'
2.28.
2
'
# Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is
...
...
This diff is collapsed.
Click to expand it.
gracedb/api/v1/events/views.py
+
24
−
3
View file @
09aeaedd
...
...
@@ -73,6 +73,10 @@ use_in(ThoroughFlexibleContentHandler)
REST_FRAMEWORK_SETTINGS
=
getattr
(
settings
,
'
REST_FRAMEWORK
'
,
{})
PAGINATE_BY
=
REST_FRAMEWORK_SETTINGS
.
get
(
'
PAGINATE_BY
'
,
10
)
# a "temporary" error message:
xml_err_msg
=
(
'
ligolw-xml rendering has been disabled, please use the
'
'
ligo-gracedb API to download event coinc xml data.
'
)
# Custom APIView class for inheriting default permissions
class
InheritPermissionsAPIView
(
InheritDefaultPermissionsMixin
,
APIView
):
pass
...
...
@@ -374,6 +378,14 @@ class EventList(InheritPermissionsAPIView):
events
=
Event
.
objects
.
filter
(
graceid__isnull
=
False
)
# FIXME 20240923: ligolw rendering has been completely broken
# since the switch from glue. That hasn't stopped some random
# processes from requesting /api/events/ in the browser and throwing
# up errors. Return a 400 for now, and revisit fixing this later
# on (HA, sure).
if
request
.
accepted_renderer
.
format
==
'
xml
'
:
return
HttpResponseBadRequest
(
xml_err_msg
)
if
query
:
# If the user is external, we must check to make sure that any query on FAR
# value is within the safe range.
...
...
@@ -410,9 +422,10 @@ class EventList(InheritPermissionsAPIView):
numRows
=
events
.
count
()
# Fail if the output format is ligolw, and there are more than 1000 events
if
request
.
accepted_renderer
.
format
==
'
xml
'
and
numRows
>
1000
:
d
=
{
'
error
'
:
'
Too many events.
'
}
return
Response
(
d
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
# FIXME when xml format is fixed
#if request.accepted_renderer.format == 'xml' and numRows > 1000:
# d = {'error': 'Too many events.' }
# return Response(d, status=status.HTTP_400_BAD_REQUEST)
last
=
max
(
0
,
(
numRows
//
count
))
*
count
rv
=
{}
...
...
@@ -569,6 +582,14 @@ class EventDetail(InheritPermissionsAPIView):
response
[
"
Cache-Control
"
]
=
"
no-cache
"
# FIXME 20240923: ligolw rendering has been completely broken
# since the switch from glue. That hasn't stopped some random
# processes from requesting /api/events/ in the browser and throwing
# up errors. Return a 400 for now, and revisit fixing this later
# on (HA, sure).
if
request
.
accepted_renderer
.
format
==
'
xml
'
:
return
HttpResponseBadRequest
(
xml_err_msg
)
# XXX Next, we try finalizing and rendering the response. According to
# the django rest framework docs (see .render() in
# http://django-rest-framework.org/api-guide/responses.html), this is
...
...
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