Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.

Commit

Permalink
Respond with 404 Not Found
Browse files Browse the repository at this point in the history
  • Loading branch information
Fingercomp committed Nov 23, 2016
1 parent a28915d commit 64cafe3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hel/views.py
Expand Up @@ -164,6 +164,8 @@ def auth(request):
context=Package,
permission='pkg_update')
def update_package(context, request):
if context.retrieve() is None:
raise HTTPNotFound()
try:
params = request.json_body
except:
Expand Down Expand Up @@ -460,6 +462,8 @@ def list_packages(context, request):
context=User,
permission='user_update')
def update_user(context, request):
if context.retrieve() is None:
raise HTTPNotFound()
try:
params = request.json_body
except:
Expand Down Expand Up @@ -507,6 +511,8 @@ def get_user(context, request):
context=User,
permission='user_delete')
def delete_user(context, request):
if context.retrieve() is None:
raise HTTPNotFound()
context.delete()

raise HTTPNoContent()
Expand Down

0 comments on commit 64cafe3

Please sign in to comment.