distinct query without "fieldname" leads to 500
Reproduce
Make a distinct-query to docstore without "fieldname".
POST http://<domain>:<port>/v0/query/study_groups?query_type=distinct
Content-Type: application/json
{"_filter": {"study_numbers": "somestudynumber"}}
Response:
{
"code": 500,
"message": "Internal Server Error"
}
Docstore log:
Traceback (most recent call last):
File "/kuha_document_store-env/lib/python3.8/site-packages/tornado/web.py", line 1713, in _execute
result = await result
File "/kuha_document_store-env/lib/python3.8/site-packages/kuha_document_store/handlers.py", line 287, in post
fieldname = self._query[Query.k_fieldname]
KeyError: 'fieldname'
Expected response would be 400: Bad Request with a validation message. Something like:
{
"code": 400,
"message": "Query type distinct requires 'fieldname'"
}