Skip to content

Conversation

@sduenas
Copy link
Member

@sduenas sduenas commented Oct 9, 2025

When an identity already stored in the database was found, the identity weren't property handled.

The code caught the exception but the database object of that identity couldn't be found. To find an identity we need the UUID but were using the value returned on the AlreadyExistError which is not the UUID, it's just the values of the duplicated entry (name, email, etc).

To fix the error, instead of using the function find_identity_by_uuid, we look for it using Django's ORM to look for the tuple (source, name, email, username) because we don't know the UUID of the identity already inserted.

@sduenas sduenas requested a review from jjmerchante October 9, 2025 15:27
@sduenas sduenas added the bug label Oct 9, 2025
@sduenas sduenas force-pushed the fix-notfound-error-importer branch from ff4836f to d36493d Compare October 9, 2025 15:37
Copy link
Contributor

@jjmerchante jjmerchante left a comment

Choose a reason for hiding this comment

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

LGTM

…rocess

When an identity already stored in the database was found,
the identity weren't properly handled.

The code caught the exception but the database object of that
identity couldn't be found. To find an identity we need the UUID
but were using the value returned on the 'AlreadyExistsError'
which is not the UUID, it's just the values of the duplicated entry
(name, email, etc).

To fix the error, instead of using the function 'find_identity_by_uuid',
we look for it using Django's ORM to look for the tuple
(source, name, email, username) because we don't know the
UUID of the identity already inserted.

Signed-off-by: Santiago Dueñas <[email protected]>
@sduenas sduenas force-pushed the fix-notfound-error-importer branch from d36493d to 5e630fe Compare October 9, 2025 16:03
@jjmerchante jjmerchante merged commit a6c9ccc into chaoss:main Oct 10, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants