dont use transaction for annotation import, fixes #2356

This commit is contained in:
j 2014-03-13 10:25:29 +01:00
parent ad89e9ffed
commit 7ef70a04e0

View file

@ -70,9 +70,10 @@ def add_annotations(data):
from user.models import User
item = Item.objects.get(itemId=data['item'])
layer_id = data['layer']
layer = filter(lambda l: l['id'] == layer_id, settings.CONFIG['layers'])[0]
layer = filter(lambda l: l['id'] == layer_id, settings.CONFIG['layers'])
if not layer:
return False
user = User.objects.get(username=data['user'])
with transaction.commit_on_success():
for a in data['annotations']:
annotation = models.Annotation(
item=item,