-
Notifications
You must be signed in to change notification settings - Fork 13
Description
qwc-data-service/src/server.py
Line 589 in 9b528ea
| relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', {}), request.files, translator) |
If relationValues is not defined in a feature, the exprssion feature.get('relationValues', '{}') creates a string object and not a dictionary. So data_service.write_relation_values() will fail when calling for (rel_table, rel_data) in relationValues.items(): here
qwc-data-service/src/data_service.py
Line 403 in 9b528ea
| for (rel_table, rel_data) in relationValues.items(): |
relationValues should be fixed by removing the '' from the {} in feature.get('relationValues', '{}'):
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', {}), request.files, translator, True)
error log in data service:
2025-06-18T08:36:49.521073372Z File "/srv/qwc_service/server.py", line 547, in post
2025-06-18T08:36:49.526129872Z relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', '{}'), request.files, translator, True)
2025-06-18T08:36:49.526367972Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-18T08:36:49.526384172Z File "/srv/qwc_service/data_service.py", line 404, in write_relation_values
2025-06-18T08:36:49.531285072Z for (rel_table, rel_data) in relationValues.items():
2025-06-18T08:36:49.531320472Z ^^^^^^^^^^^^^^^^^^^^
2025-06-18T08:36:49.531539172Z AttributeError: 'str' object has no attribute 'items'