IA-3772: Skip existing org units when importing data (hotfix)#2532
Merged
IA-3772: Skip existing org units when importing data (hotfix)#2532
Conversation
tdethier
reviewed
Nov 6, 2025
tdethier
approved these changes
Nov 6, 2025
Member
tdethier
left a comment
There was a problem hiding this comment.
LGTM, thanks for diving a bit deeper on this 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
refs: IA-3772
Hotfix for exceptions raised by PR #2522
When attempting to create an OrgUnit that already exists, an AssertionError is thrown:
AssertionError:create()did not return an object instance.This PR fixes the error and replicates the original behavior of ignoring the existing OrgUnits.
Self proofreading checklist
Are my typescript files well typed?New translations have been added or updated if new strings have been introduced in the frontendMy migrations file are includedDocumentation has been included (for new feature)Doc
Changes
How to test
You may want to test the features of the original PR #2522 as well
Print screen / video
/
Notes
Didn't want to change anything else, however, in removing the
create()method on the serializer, I realized that both the code introduced by my PR and the original code set attributes on the OrgUnits that don't exist on the model and were silently ignored. I had to remove them when getting rid of the custom create logic assourceandaccuracywere passed to the OrgUnit's constructor and trigger TypeError.Follow the Conventional Commits specification
The merge message of a pull request must follow the Conventional Commits specification.
This convention helps to automatically generate release notes.
Use lowercase for consistency.
Example:
Note that the Jira reference is preceded by a line break.
Both the line break and the Jira reference are entered in the Add an optional extended description… field.