made shure that tools works with lazy tables (but auth_* fields not lazy)

This commit is contained in:
mdipierro
2012-08-17 22:45:56 -05:00
parent 872a311320
commit c48c06e83d
3 changed files with 10 additions and 9 deletions
+6 -5
View File
@@ -1383,11 +1383,12 @@ class Auth(object):
signature_list = [signature]
else:
signature_list = signature
lazy_tables, db._lazy_tables = db._lazy_tables, False
if not settings.table_user_name in db.tables:
passfield = settings.password_field
extra_fields = settings.extra_fields.get(
settings.table_user_name,[])+signature_list
if username or settings.cas_provider:
if username or settings.cas_provider:
table = db.define_table(
settings.table_user_name,
Field('first_name', length=128, default='',
@@ -1570,6 +1571,7 @@ class Auth(object):
settings.table_user_name,
settings.table_user._format)
settings.table_cas = db[settings.table_cas_name]
db._lazy_tables = lazy_tables
if settings.cas_provider:
settings.actions_disabled = \
['profile','register','change_password','request_reset_password']
@@ -3118,13 +3120,12 @@ class Auth(object):
table = form.table
if not archive_table:
archive_table_name = '%s_archive' % table
if archive_table_name in table._db:
archive_table = table._db[archive_table_name]
else:
archive_table = table._db.define_table(
if not archive_table_name in table._db:
table._db.define_table(
archive_table_name,
Field(current_record,table),
*[field.clone(unique=False) for field in table])
archive_table = table._db[archive_table_name]
new_record = {current_record:form.vars.id}
for fieldname in archive_table.fields:
if not fieldname in ['id',current_record]: