Skip to content

Commit a6c9ccc

Browse files
authored
Merge branch 'fix-notfound-error-importer' of 'https://github.com/sduenas/sortinghat'
Merges #1015 Closes #1015
2 parents ffe7098 + 5e630fe commit a6c9ccc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Error of duplicated identities fixed during the import
3+
category: fixed
4+
author: Santiago Dueñas <[email protected]>
5+
issue: null
6+
notes: >
7+
Duplicated identities found during the import process
8+
weren't property handled which made the process to
9+
stop with an exception.

sortinghat/core/importer/backend.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
import sortinghat.core.importer.backends
2525
from grimoirelab_toolkit.introspect import inspect_signature_parameters
26-
from .. import api, db
26+
from .. import api
2727
from ..errors import (LoadError,
2828
InvalidValueError,
2929
AlreadyExistsError,
3030
NotFoundError,
3131
DuplicateRangeError)
3232
from ..importer.utils import find_backends
33-
from ..models import MIN_PERIOD_DATE, MAX_PERIOD_DATE
33+
from ..models import MIN_PERIOD_DATE, MAX_PERIOD_DATE, Identity
3434

3535
logger = logging.getLogger(__name__)
3636

@@ -152,7 +152,10 @@ def __load_identities(self, identities):
152152
except InvalidValueError as e:
153153
logger.warning(str(e))
154154
except AlreadyExistsError as e:
155-
stored_identity = db.find_identity(e.eid)
155+
stored_identity = Identity.objects.get(source=identity.source,
156+
email=identity.email,
157+
name=identity.name,
158+
username=identity.username)
156159
stored_uuid = stored_identity.individual.mk
157160

158161
if not uuid:

0 commit comments

Comments
 (0)