Add validation for sellingMethod field
Add type validation for sellingMethod field before object creation
[2020-06-11T06:31:30 +0000] | prozorro_sale.procedure.errors | ERROR - Unknown error caught in API - unhashable type: 'dict' | X-Request-ID: 5a90ded2-515c-4916-8730-8ea913de788f
Traceback (most recent call last):
File "/procedure/prozorro_sale/procedure/errors.py", line 81, in request_errors_middleware
return await handler(request)
File "/usr/local/lib/python3.8/site-packages/prozorro_sale/auth/__init__.py", line 67, in context_middleware
return await handler(request)
File "/usr/local/lib/python3.8/site-packages/prozorro_sale/auth/__init__.py", line 74, in access_middleware
return await check_access(handler)(request)
File "/usr/local/lib/python3.8/site-packages/prozorro_sale/auth/__init__.py", line 83, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/utils.py", line 126, in accept_language_middleware
return await handler(request)
File "/procedure/prozorro_sale/procedure/errors.py", line 116, in retry_on_concurrency_error_middleware
return await handler(request)
File "/procedure/prozorro_sale/procedure/errors.py", line 100, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/utils.py", line 100, in request_unpack_params
return await handler(request, **request.match_info)
File "/procedure/prozorro_sale/procedure/utils.py", line 75, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/errors.py", line 100, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/api.py", line 57, in create_procedure
procedure = model_generator.create_procedure(data, owner=user.name)
File "/procedure/prozorro_sale/procedure/model_generator.py", line 61, in create_procedure
procType = get_procedure_type_from_data(data)
File "/procedure/prozorro_sale/procedure/model_generator.py", line 51, in get_procedure_type_from_data
if data['sellingMethod'] not in MODEL_MAPPING:
TypeError: unhashable type: 'dict'