示例#1
0
def get_current_user(self):
	userkey = helpers.get_user_cookie(self)
	if len(userkey) >0:
		user = db.get(db.Key(userkey))
		if user:
			user.put()
	else:
		user = False
	return user
示例#2
0
def do_logout(self):
	userkey = helpers.get_user_cookie(self)
	if len(userkey) >0:
		user = db.get(db.Key(userkey))
		if user:
			user.put()
	else:
		user = False
	helpers.destroy_user_cookie(self)