Hide First and Last name in Auth_User

57 views
Skip to first unread message

Warrick

unread,
Dec 11, 2013, 7:25:24 AM12/11/13
to web...@googlegroups.com
Prior to updating to 2.8.2 I could user the following code to hide the fields:

db.auth_user.first_name.readable = db.auth_user.first_name.writable = False
db
.auth_user.last_name.readable = db.auth_user.last_name.writable = False

However, now I receive an error:

<type 'exceptions.AttributeError'> 'DAL' object has no attribute 'auth_user'


any suggestions?

Leonel Câmara

unread,
Dec 11, 2013, 12:00:36 PM12/11/13
to web...@googlegroups.com
Are you doing this before or after you call auth.define_tables ?

If after, what happens if you do this instead:

db.auth_user  # Just to check if some lazy table weirdness is going on
db.auth_user.first_name.readable = db.auth_user.first_name.writable = False
db
.auth_user.last_name.readable = db.auth_user.last_name.writable = False

Ben Lawrence

unread,
Aug 29, 2015, 9:04:35 PM8/29/15
to web2py-users
Just for the record, this works for me {2.11.2-stable+timestamp.2015.05.30.16.33.24
(Running on Apache/2.4.7 (Ubuntu), Python 2.7.6)}

auth.define_tables(username=False, signature=False)
db.auth_user.last_name.writable = db.auth_user.last_name.readable = False
Reply all
Reply to author
Forward
0 new messages