Commit ee53df63 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

make error messages compatible with the registry api

parent 2bf5a74d
......@@ -51,14 +51,16 @@ def pre_pushpull(request, action):
# find the relevant webapp
webapp = Webapp.objects.get(docker_name=repo)
except Webapp.DoesNotExist:
return JsonResponse({"error": "unknown repository"}, status=404)
return JsonResponse({"errors": [
{"code": "NAME_INVALID", "message": "unknown repository"}]}, status=404)
if action == "pull":
# find the id of the WebappVersion to be pulled
version = WebappVersion.objects.filter(webapp=webapp, number=tag,
if version is None:
return JsonResponse({"error": "unknown tag"}, status=404)
return JsonResponse({"errors": [
{"code": "TAG_INVALID", "message": "unknown tag"}]}, status=404)
elif action == "push":
# create a new WebappVersion entry in state USER
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment