Commit 31fbf598 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Fix a check in client api

parent 166c1697
......@@ -36,11 +36,16 @@ class ResponseView(views.APIView):
state_id = request.data.get('id', None)
_service = request.data.get('service', {})
if state_id is None:
err = 'no state id'
LOGGER.error('Error parsing response from %s: %s', request.user, err)
return response_view_error(err)
service = None
service_query = client_site.services.filter(
name=_service['name'],
name=_service.get('name', ''),
)
#LOGGER.debug("[ResponseView]services: %s %s", service_query, len(service_query))
# LOGGER.debug("[ResponseView]services: %s %s", service_query, len(service_query))
if service_query.exists() and len(service_query) == 1:
service = service_query.first()
else:
......@@ -51,11 +56,6 @@ class ResponseView(views.APIView):
)
return response_view_error('unable to determine service')
if state_id is None:
err = 'no state id'
LOGGER.error('Error parsing response from %s: %s', request.user, err)
return response_view_error(err)
# find the corresponding NewDeploymentStateItem for this response
try:
state_item = client_site.state_items.get(
......
Markdown is supported
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