Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Error of duplicated identities fixed during the import
category: fixed
author: Santiago Dueñas <[email protected]>
issue: null
notes: >
Duplicated identities found during the import process
weren't property handled which made the process to
stop with an exception.
9 changes: 6 additions & 3 deletions sortinghat/core/importer/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

import sortinghat.core.importer.backends
from grimoirelab_toolkit.introspect import inspect_signature_parameters
from .. import api, db
from .. import api
from ..errors import (LoadError,
InvalidValueError,
AlreadyExistsError,
NotFoundError,
DuplicateRangeError)
from ..importer.utils import find_backends
from ..models import MIN_PERIOD_DATE, MAX_PERIOD_DATE
from ..models import MIN_PERIOD_DATE, MAX_PERIOD_DATE, Identity

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -152,7 +152,10 @@ def __load_identities(self, identities):
except InvalidValueError as e:
logger.warning(str(e))
except AlreadyExistsError as e:
stored_identity = db.find_identity(e.eid)
stored_identity = Identity.objects.get(source=identity.source,
email=identity.email,
name=identity.name,
username=identity.username)
stored_uuid = stored_identity.individual.mk

if not uuid:
Expand Down
Loading