Fix 500 error on contract creation
Create contract with list as data
[2021-02-08T15:16:00.576Z] | prozorro_sale.registry.errors | ERROR - Unknown error caught in API - 'list' object has no attribute 'get' | X-Request-ID: 722305b5-504e-4bce-8777-cadaecc25d54
Traceback (most recent call last):
File "/registry/prozorro_sale/registry/errors.py", line 53, in request_errors_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 107, in context_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 114, in access_middleware
return await check_access(handler)(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 123, in handler
return await func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 81, in retry_on_concurrency_error_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 67, in handler
return await func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 45, in request_unpack_params
return await handler(request, **request.match_info)
File "/registry/prozorro_sale/registry/api.py", line 364, in create_contract
contract_info = registry_obj.create_contract(data, request._context)
File "/registry/prozorro_sale/registry/models/base.py", line 376, in create_contract
contract = self.Contract(data, role='owner')
File "/usr/local/lib/python3.9/site-packages/schematics/models.py", line 101, in __init__
f_value = data.get(field, Undefined)
AttributeError: 'list' object has no attribute 'get'
Add validation that data should be dictionary