Use transactions on import; fix for date parser re-location
svn: r19667
This commit is contained in:
parent
6f6c914649
commit
7b97bef883
@ -120,7 +120,7 @@ from gen.updatecallback import UpdateCallback
|
||||
import gen.mime
|
||||
import LdsUtils
|
||||
import Utils
|
||||
from gen.datehandler._DateParser import DateParser
|
||||
import gen.datehandler._dateparser as DateParser
|
||||
from gen.db.dbconst import EVENT_KEY
|
||||
from QuestionDialog import WarningDialog
|
||||
from gen.lib.const import IDENTICAL, DIFFERENT
|
||||
|
@ -43,6 +43,7 @@ from gen.db import (PERSON_KEY,
|
||||
NOTE_KEY)
|
||||
import Utils
|
||||
from webapp.libdjango import DjangoInterface
|
||||
from django.db import transaction
|
||||
|
||||
class Cursor(object):
|
||||
def __init__(self, model, func):
|
||||
@ -177,6 +178,7 @@ class DbDjango(DbWriteBase, DbReadBase):
|
||||
import for two step adding.
|
||||
"""
|
||||
# First we add the primary objects:
|
||||
with transaction.commit_on_success():
|
||||
for key in self.import_cache.keys():
|
||||
obj = self.import_cache[key]
|
||||
if isinstance(obj, gen.lib.Person):
|
||||
|
Loading…
Reference in New Issue
Block a user