I have a profile class:
class profile(db.Model):
user = db.stringProperty()
# Other properties ...
access = db.ListProperty(db.keys)
class apps(db.Model):
name = db.StringProperty()
The profile class was there for quiet some time, but we added recently access field which will store the keys of apps. Now we are adding profile permissions on the app, access field does not get updated in the model.
This works fine totally on localhost, but when I update this on server I get this error "'NoneType' object has no attribute 'access'" Has anybody come across same situation
Update: Figured out that one of the object from profile class is being returned as None. Here is the code which gets profile object on localhost but None on the server
liuser = users.User(request.POST['user'])
#request.POST['user'] gets user Gmail ID, which is being converted to user object
profiles=Profile.all().filter(" user =", liuser).get()
userprofile=profiles
#tried below code which returns "'NoneType' object has no attribute 'access'" on server, the same gets a profile object on localhost
if not hasattr(userprofile, "access"):
userprofile.access=[]
@Robert hope the formatting is fine now.
Thank You Sai Krishna
We were able to fix this. The problem was with users.User object which does not append @gmail.com for gmail users, but while it accepts for other domains with domain name, which was throwing None Type object
Thank You once again for the help