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
443f6fbb
Commit
443f6fbb
authored
10 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Some fixes for the EMBB resources in API.
parent
f0e34a54
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/api.py
+16
-22
16 additions, 22 deletions
gracedb/api.py
with
16 additions
and
22 deletions
gracedb/api.py
+
16
−
22
View file @
443f6fbb
...
...
@@ -990,21 +990,11 @@ class EventLogDetail(APIView):
# Janky serialization
def
embbEventLogToDict
(
eel
,
request
=
None
):
uri
=
None
taglist_uri
=
None
file_uri
=
None
if
request
:
uri
=
reverse
(
"
embbevent
eel
-detail
"
,
uri
=
reverse
(
"
embbevent
log
-detail
"
,
args
=
[
eel
.
event
.
graceid
(),
eel
.
N
],
request
=
request
)
if
eel
.
filename
:
actual_filename
=
eel
.
filename
if
eel
.
file_version
:
actual_filename
+=
'
,%d
'
%
eel
.
file_version
filename
=
urlquote
(
actual_filename
)
file_uri
=
reverse
(
"
files
"
,
args
=
[
eel
.
event
.
graceid
(),
filename
],
request
=
request
)
return
{
"
comment
"
:
eel
.
comment
,
"
created
"
:
eel
.
created
,
...
...
@@ -1028,11 +1018,12 @@ class EMBBEventLogList(APIView):
# XXX Real error message.
return
Response
(
"
Event does not exist.
"
,
status
=
status
.
HTTP_404_NOT_FOUND
)
embblogset
=
event
.
embbeventlog_set
.
order_by
(
"
created
"
,
"
N
"
)
count
=
embblogset
.
count
()
eel_set
=
event
.
embbeventlog_set
.
order_by
(
"
created
"
,
"
N
"
)
count
=
eel_set
.
count
()
eel
=
[
embbEventLogToDict
(
eel
,
request
)
for
eel
in
e
mbblog
set
.
iterator
()
]
for
eel
in
e
el_
set
.
iterator
()
]
rv
=
{
'
start
'
:
0
,
...
...
@@ -1046,17 +1037,21 @@ class EMBBEventLogList(APIView):
}
return
Response
(
rv
)
def
post
(
self
,
request
,
graceid
):
event
=
Event
.
getByGraceid
(
graceid
)
# message -> comment
try
:
event
=
Event
.
getByGraceid
(
graceid
)
except
Event
.
DoesNotExist
:
return
Response
(
"
Event Not Found
"
,
status
=
status
.
HTTP_404_NOT_FOUND
)
# Now create the EEL
try
:
eel
=
create_eel
(
request
.
DATA
,
event
,
request
.
user
)
# XXX Need to handle multiple exception types here.
except
Exception
,
e
:
pass
# Since this is likely due to race conditions, we will return 503
return
Response
(
"
Problem creating EEL: %s
"
%
str
(
e
),
status
=
status
.
HTTP_400_BAD_REQUEST
)
# Since this is likely due to race conditions, we will return 503
# return Response("Failed to save log entry: %s" % str(e),
# status=status.HTTP_503_SERVICE_UNAVAILABLE)
...
...
@@ -1066,6 +1061,7 @@ class EMBBEventLogList(APIView):
# Issue alert.
description
=
"
New EMBB log entry.
"
issueAlertForUpdate
(
event
,
description
,
doxmpp
=
True
)
return
response
...
...
@@ -1087,8 +1083,6 @@ class EMBBEventLogDetail(APIView):
return
Response
(
embbEventLogToDict
(
rv
,
request
=
request
))
#==================================================================
# Tags
...
...
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