Skip to content

Conversation

@mauromsl
Copy link
Member

@mauromsl mauromsl commented Dec 5, 2025

Instead of creating additional organizations, we use a pre-exiting one

@mauromsl mauromsl changed the base branch from master to r-v1.8.x December 5, 2025 14:43
@mauromsl mauromsl requested a review from ajrbyers December 5, 2025 14:43
@mauromsl mauromsl force-pushed the fix-handling-duplicate-organization branch from af57bca to 8a5b88c Compare December 5, 2025 14:45
@joemull
Copy link
Member

joemull commented Dec 8, 2025

What's the bug behind this change @mauromsl ?

@mauromsl
Copy link
Member Author

mauromsl commented Dec 9, 2025

What's the bug behind this change @mauromsl ?

During an import, we saw a MultipleObjectsReturned exception being raised here where the change is made. When creating a new object in the exception handler, with an IntegrityError against a unique constraint. relying on the pre-existing db record solved the issue

@joemull
Copy link
Member

joemull commented Dec 9, 2025

During an import, we saw a MultipleObjectsReturned exception being raised here where the change is made. When creating a new object in the exception handler, with an IntegrityError against a unique constraint. relying on the pre-existing db record solved the issue

Hmm, which model was the unique constraint on? The only unique constraint on Organization is related to ror_id, but it can be an empty string, so that should not be an issue here.

The problem with relying on a pre-existing organization for a custom-named org is that the linked OrganizationName will be editable by end users. I could edit my affiliation and end up changing yours too. So, orgs that have custom names should not be used across accounts.

@joemull joemull added this to the v1.8.0 Tracker milestone Jan 5, 2026
@joemull joemull self-requested a review January 5, 2026 09:47
Copy link
Member

@joemull joemull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going ahead and submitting a review to show the comment above as a requested change.

@mauromsl
Copy link
Member Author

I cannot reproduce this any longer, so I'm going to assume it was due to an unexpected state in a prod DB

@mauromsl mauromsl closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants