From 78e56ce3bfabc19c39796dd1b96a04a803ebb57c Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 1 Aug 2012 17:04:40 -0500 Subject: [PATCH] avoid attemts to duplicate archive tables --- VERSION | 2 +- gluon/dal.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 77c9380a..db26717e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-01 12:01:12) dev +Version 2.00.0 (2012-08-01 17:04:35) dev diff --git a/gluon/dal.py b/gluon/dal.py index a20579f0..892ecaee 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7290,8 +7290,10 @@ class Table(dict): current_record = 'current_record', is_active = 'is_active'): archive_db = archive_db or self._db - fieldnames = self.fields() archive_name = archive_name % dict(tablename=self._tablename) + if archive_name in archive_db.tables(): + return # do not try define the archive if already exists + fieldnames = self.fields() field_type = self if archive_db is self._db else 'bigint' archive_table = archive_db.define_table( archive_name,