forked from p15670423/monkey
Island: Use schema.loads in AgentConfiguration POST method
This commit is contained in:
parent
d7329ea839
commit
42c4803376
|
@ -26,9 +26,7 @@ class AgentConfiguration(AbstractResource):
|
||||||
def post(self):
|
def post(self):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
request_contents = json.loads(request.data)
|
configuration_object = self._schema.loads(request.data)
|
||||||
|
|
||||||
configuration_object = self._schema.load(request_contents)
|
|
||||||
self._agent_configuration_repository.store_configuration(configuration_object)
|
self._agent_configuration_repository.store_configuration(configuration_object)
|
||||||
return make_response({}, 200)
|
return make_response({}, 200)
|
||||||
except (marshmallow.exceptions.ValidationError, json.JSONDecodeError) as err:
|
except (marshmallow.exceptions.ValidationError, json.JSONDecodeError) as err:
|
||||||
|
|
Loading…
Reference in New Issue