summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Odagiri <aodagx@gmail.com>2010-11-27 15:08:07 +0900
committerAtsushi Odagiri <aodagx@gmail.com>2010-11-27 15:08:07 +0900
commitba32a8d0dcee7f3cef231e08ed60d52fbf60ed4f (patch)
treeef174a73260da1d80001c94f8e9006760ff537aa
parenta6cd3dab239920ba14629083d8f36b56141ca0dc (diff)
downloadpyramid-ba32a8d0dcee7f3cef231e08ed60d52fbf60ed4f.tar.gz
pyramid-ba32a8d0dcee7f3cef231e08ed60d52fbf60ed4f.tar.bz2
pyramid-ba32a8d0dcee7f3cef231e08ed60d52fbf60ed4f.zip
::
InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (IntegrityError) column name is not unique u'INSERT INTO models (name, value) VALUES (?, ?)' (u'root', 55)
-rwxr-xr-xpyramid/paster_templates/alchemy/+package+/models.py2
-rw-r--r--pyramid/paster_templates/pylons_sqla/+package+/models.py2
-rw-r--r--pyramid/paster_templates/routesalchemy/+package+/models.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/pyramid/paster_templates/alchemy/+package+/models.py b/pyramid/paster_templates/alchemy/+package+/models.py
index 336613cf9..b0a00b648 100755
--- a/pyramid/paster_templates/alchemy/+package+/models.py
+++ b/pyramid/paster_templates/alchemy/+package+/models.py
@@ -81,7 +81,7 @@ def initialize_sql(db_string, db_echo=False):
try:
populate()
except IntegrityError:
- pass
+ DBSession.rollback()
def appmaker(db_string, db_echo=False):
initialize_sql(db_string, db_echo)
diff --git a/pyramid/paster_templates/pylons_sqla/+package+/models.py b/pyramid/paster_templates/pylons_sqla/+package+/models.py
index 092166902..e1fc7f43c 100644
--- a/pyramid/paster_templates/pylons_sqla/+package+/models.py
+++ b/pyramid/paster_templates/pylons_sqla/+package+/models.py
@@ -44,4 +44,4 @@ def initialize_sql(db_string, db_echo=False):
try:
populate()
except IntegrityError:
- pass
+ DBSession.rollback()
diff --git a/pyramid/paster_templates/routesalchemy/+package+/models.py b/pyramid/paster_templates/routesalchemy/+package+/models.py
index a1726ebf4..fd439a4c2 100644
--- a/pyramid/paster_templates/routesalchemy/+package+/models.py
+++ b/pyramid/paster_templates/routesalchemy/+package+/models.py
@@ -41,4 +41,4 @@ def initialize_sql(db_string, db_echo=False):
try:
populate()
except IntegrityError:
- pass
+ DBSession.rollback()