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
86cb5f89
Commit
86cb5f89
authored
12 years ago
by
Branson Stephens
Committed by
Brian Moe
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added DELETE method for slots.
parent
dca42ec4
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
+22
-1
22 additions, 1 deletion
gracedb/api.py
with
22 additions
and
1 deletion
gracedb/api.py
+
22
−
1
View file @
86cb5f89
...
...
@@ -817,7 +817,7 @@ class EventSlot(APIView):
try
:
slot
=
Slot
.
objects
.
filter
(
event
=
event
).
filter
(
name
=
slotname
)[
0
]
except
Slot
.
DoesNotExist
:
except
:
# Okay, no slot yet. Probably want an error message.
# Try looking for files that contain the slot name.
return
Response
(
"
No slot. Search based on slotname not implemented yet.
"
,
...
...
@@ -859,3 +859,24 @@ class EventSlot(APIView):
slot
.
save
()
return
Response
(
"
Slot created.
"
,
status
=
status
.
HTTP_201_CREATED
)
# Delete a slot.
def
delete
(
self
,
request
,
graceid
,
slotname
):
try
:
event
=
Event
.
getByGraceid
(
graceid
)
except
Event
.
DoesNotExist
:
# XXX Real error message.
return
Response
(
"
Event does not exist.
"
,
status
=
status
.
HTTP_404_NOT_FOUND
)
# Gotta find the poor devil before we can delete him.
try
:
slot
=
Slot
.
objects
.
filter
(
event
=
event
).
filter
(
name
=
slotname
)[
0
]
except
:
# Okay, no slot yet. Probably want an error message.
# Try looking for files that contain the slot name.
return
Response
(
"
No such slot.
"
,
status
=
status
.
HTTP_404_NOT_FOUND
)
slot
.
delete
()
return
Response
(
"
Slot deleted.
"
,
status
=
status
.
HTTP_200_OK
)
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