OpenConceptLab/ocl_issues#2295 | POST concepts with mappings#818
OpenConceptLab/ocl_issues#2295 | POST concepts with mappings#818snyaggarwal merged 2 commits intomasterfrom
Conversation
filiperochalopes
left a comment
There was a problem hiding this comment.
I believe we have two simple outstanding issues: one that could lead to the concept being incorrectly persisted, even in the case of an error that doesn't trigger the exception we have in place, and another related to the content mappings required for this use case. Do we need from_concept_url within the mappings for this use case?
| any_with_errors = False | ||
| if mappings and self.id: | ||
| user = self.created_by | ||
| for mapping_data in mappings: |
There was a problem hiding this comment.
The absence of specific mapping validation here can trigger a 500 error with a TypeError, preventing the rollback and persisting the concept even in the event of a payload failure.
There was a problem hiding this comment.
_create_mapping_from_self is under try/catch block.
this calls Mapping.persist_new which runs validation based on repo validation schema.
if there are any errors in mapping creation they populate errors here in catch block or down below when serializing.
There was a problem hiding this comment.
Yes, _create_mapping_from_self is within a try-catch block, but the error in for mapping_data in mappings is not caught if it's not an expected list. However, the initial validation that was performed already resolves this by returning a 400 error beforehand. Thanks
No description provided.