Permalink
Browse files

Return 404 response when member not found for DELETE.

  • Loading branch information...
1 parent a6d8c47 commit 7e2c423491ff7c0679dc317dc020dee463c76ac1 @wylee committed Nov 22, 2011
Showing with 4 additions and 1 deletion.
  1. +1 −0 pyramid_restler/model.py
  2. +3 −1 pyramid_restler/view.py
View
@@ -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
@@ -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):

0 comments on commit 7e2c423

Please sign in to comment.