Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return 404 response when member not found for DELETE.

  • Loading branch information...
commit 7e2c423491ff7c0679dc317dc020dee463c76ac1 1 parent a6d8c47
@wylee authored
Showing with 4 additions and 1 deletion.
  1. +1 −0  pyramid_restler/model.py
  2. +3 −1 pyramid_restler/view.py
View
1  pyramid_restler/model.py
@@ -133,6 +133,7 @@ def delete_member(self, id):
return None
self.session.delete(member)
self.session.commit()
+ return member
def get_member_id(self, member):
pk = member._sa_instance_state.key
View
4 pyramid_restler/view.py
@@ -52,7 +52,9 @@ def update_member(self):
def delete_member(self):
id = self.request.matchdict['id']
- self.context.delete_member(id)
+ member = self.context.delete_member(id)
+ if member is None:
+ raise HTTPNotFound(self.context)
return Response(status=204, content_type='')
def render_to_response(self, value, fields=None):
Please sign in to comment.
Something went wrong with that request. Please try again.