def nickname_check(self, *args): profile_path = args[0].lower() profile_path = profile_path.replace(' ','_') from model.user import Profile same_path = Profile.gql("WHERE profile_path = :1", profile_path).fetch(1) if same_path: return "not_available" else: return "available"
def reset_account(self): from model.user import Profile this_profile = Profile.gql("WHERE email = :1", self.request.get('email')).get() if this_profile: from accounts.mail import reset_account_access reset_account_access(this_profile) return "OK" return "Profile Not Found"
def get_profile(self): if not len(self.request.path.split('/sponsor/')[1]) > 0: return False from model.user import Profile self.profile = Profile.gql('WHERE profile_path = :1', self.request.path.split('/sponsor/')[1].lower()).get() try: self.profile.unique_identifier except: self.redirect('/profile_not_found/') return False return True