Revision 0a24e225 commissioning/servers/quotaholder/django_backend/callpoint.py

b/commissioning/servers/quotaholder/django_backend/callpoint.py
9 9

  
10 10
from commissioning.utils.newname import newname
11 11
from django.db.models import Model, BigIntegerField, CharField, ForeignKey
12
from django.db import transaction
12
from django.db import transaction, IntegrityError
13 13
from .models import Holder, Entity, Policy, Holding, Commission, Provision
14 14

  
15 15

  
......
66 66
                append(entity)
67 67
                continue
68 68

  
69
            Entity.objects.create(entity=entity, owner=owner, key=key)
69
            try:
70
                Entity.objects.create(entity=entity, owner=owner, key=key)
71
            except IntegrityError:
72
                append(entity)
70 73

  
71 74
        return rejected
72 75

  

Also available in: Unified diff