Browse files

Use `LOOKUP_SEP` in `get_or_create`.

  • Loading branch information...
charettes committed Apr 18, 2013
1 parent a98465c commit 356443fd956c45e66c24256edc8f673d773b6ac8
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/
@@ -466,14 +466,14 @@ def get_or_create(self, **kwargs):
return self.get(**lookup), False
except self.model.DoesNotExist:
params = dict([(k, v) for k, v in kwargs.items() if '__' not in k])
params = dict((k, v) for k, v in kwargs.items() if LOOKUP_SEP not in k)
obj = self.model(**params)
sid = transaction.savepoint(using=self.db), using=self.db)
transaction.savepoint_commit(sid, using=self.db)
return obj, True
except IntegrityError as e:
except IntegrityError:
transaction.savepoint_rollback(sid, using=self.db)
exc_info = sys.exc_info()

0 comments on commit 356443f

Please sign in to comment.