Describe the bug
The input_datetime custom attribute needs a value tag (usually set to empty string "") to work properly.
The front end doesn't validate the presence of this value, which gets the back to throw an ambiguous error 500, only visible in stderr.
Additionally, the documentation isn't clear about this tag being required, as only the input_checkbox seems to need it, and no mandatory tags are mentioned for input_datetime.
Python traceback
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/iriswebapp/app/util.py", line 747, in wrap
return f(*args, **kwargs)
File "/iriswebapp/app/blueprints/manage/manage_attributes_routes.py", line 127, in update_attribute
attr_contents, logs = validate_attribute(attr_content)
File "/iriswebapp/app/datamgmt/manage/manage_attribute_db.py", line 267, in validate_attribute
f'but got {type(data[tab][field]["value"])}')
KeyError: 'value'
To Reproduce
Steps to reproduce the behavior:
- Go to 'Advanced', 'Custom Attributes'
- Click on 'Case' or any other 'Attribute'
- Write the JSON below in the 'Attribute Definition'
- Click on 'Complet Overwrite', 'Partial Overwrite' or 'Update' to trigger the error.
Json
{
"A": {
"B": {
"type": "input_datetime",
"mandatory": false
}
}
Expected behavior
The presence of this required value should be checked by the front-end, and if missing, should raise an error.
A popup already exists for other missing tags that are required, ex:
Found errors in attribute
Logs:
[REDACTED] -> [REDACTED] of type input_select is missing the mandatory "value" tag
Describe the bug
The
input_datetimecustom attribute needs avaluetag (usually set to empty string "") to work properly.The front end doesn't validate the presence of this value, which gets the back to throw an ambiguous error 500, only visible in stderr.
Additionally, the documentation isn't clear about this tag being required, as only the
input_checkboxseems to need it, and no mandatory tags are mentioned forinput_datetime.Python traceback
To Reproduce
Steps to reproduce the behavior:
Json
{ "A": { "B": { "type": "input_datetime", "mandatory": false } }Expected behavior
The presence of this required value should be checked by the front-end, and if missing, should raise an error.
A popup already exists for other missing tags that are required, ex: