diff options
| author | Atsushi Odagiri <aodagx@gmail.com> | 2010-11-27 15:08:07 +0900 |
|---|---|---|
| committer | Atsushi Odagiri <aodagx@gmail.com> | 2010-11-27 15:08:07 +0900 |
| commit | ba32a8d0dcee7f3cef231e08ed60d52fbf60ed4f (patch) | |
| tree | ef174a73260da1d80001c94f8e9006760ff537aa | |
| parent | a6cd3dab239920ba14629083d8f36b56141ca0dc (diff) | |
| download | pyramid-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)
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() |
