diff options
author | Frederick Muriuki Muriithi | 2024-06-17 10:57:17 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-17 10:57:17 -0500 |
commit | 03bbb4df4e7a6a6b0bbccfabe8a28b380d12bd80 (patch) | |
tree | 41981115fa36a1bf36ba56d012e45da3c69216af /gn_auth/auth/authorisation/data | |
parent | 9f1b11d2756010647051bf213ceed3f374524bbb (diff) | |
download | gn-auth-03bbb4df4e7a6a6b0bbccfabe8a28b380d12bd80.tar.gz |
Use the form's json attribute to retrieve sent data
The system uses JSON as the default communication format, so we use
the form's json attribute to get any data sent.
Diffstat (limited to 'gn_auth/auth/authorisation/data')
-rw-r--r-- | gn_auth/auth/authorisation/data/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gn_auth/auth/authorisation/data/views.py b/gn_auth/auth/authorisation/data/views.py index 83f4e4b..86dafe5 100644 --- a/gn_auth/auth/authorisation/data/views.py +++ b/gn_auth/auth/authorisation/data/views.py @@ -186,16 +186,16 @@ def __search_mrna__(): def __request_key__(key: str, default: Any = ""): if bool(request.json): return request.json.get(#type: ignore[union-attr] - key, request.args.get(key, request.form.get(key, default))) - return request.args.get(key, request.form.get(key, default)) + key, request.args.get(key, request.json.get(key, default))) + return request.args.get(key, request.json.get(key, default)) def __request_key_list__(key: str, default: tuple[Any, ...] = tuple()): if bool(request.json): return (request.json.get(key,[])#type: ignore[union-attr] - or request.args.getlist(key) or request.form.getlist(key) + or request.args.getlist(key) or request.json.getlist(key) or list(default)) return (request.args.getlist(key) - or request.form.getlist(key) or list(default)) + or request.json.getlist(key) or list(default)) def __search_genotypes__(): query = __request_key__("query", "") |