summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()