fix(tags): resolve issue with study.additional_data.patch
attribute reading
#1944
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
This pull request resolves an issue encountered when reading the
study.additional_data.patch
attribute in cases wherethe study lacks an
additional_data
instance.The
additional_data
attribute is designed to be optional, but an error occurred when attempting to access it withoutensuring its presence.
Problem Origin
The anomaly originated during the implementation phase of managing tags within the database,
instead of retrieving the list of tags from a designated file "patch.json".
Solution
The code now appropriately checks for the existence of the
additional_data
instance before attempting to access itsattributes.
additional_data
attribute is missing.additional_data
is present, thestudy.additional_data.patch
attribute is read as expected.Testing
Comprehensive testing has been performed to validate the effectiveness of the implemented solution.
Related pull requests
tag
andstudy_tag
tables using pre-existing patch data instudy_additional_data
table #1929tag
andstudy_tag
migration script #1934