def send_email(user, game_name): """ Send verification email to user """ random_path = ''.join(random.choice(string.letters + string.digits) for i in xrange(24)) message = mail.EmailMessage(sender="%s Verifier < *****@*****.**>" % game_name, subject="Your account needs to be verified") message.to = decrypt(user.email) message.body = "Welcome to %s. Please click the following link to complete the sign-up process.\n" % game_name message.body += "\n" message.body += "https://yaauthservice.appspot.com/user/verify/" + random_path message.send() user.verification = random_path
def send_email(user, game_name): """ Send verification email to user """ random_path = ''.join( random.choice(string.letters + string.digits) for i in xrange(24)) message = mail.EmailMessage( sender="%s Verifier < *****@*****.**>" % game_name, subject="Your account needs to be verified") message.to = decrypt(user.email) message.body = "Welcome to %s. Please click the following link to complete the sign-up process.\n" % game_name message.body += "\n" message.body += "https://yaauthservice.appspot.com/user/verify/" + random_path message.send() user.verification = random_path
def to_dict(self): dicty = {} # Handle date properties for property in ("create_date", "modify_date", "last_login_date"): dicty[property] = str(getattr(self, property)) # Handle encrypted properties for property in ('email', 'phone'): dicty[property] = decrypt(getattr(self, property)) logging.debug('Property ' + property + ' is:' + dicty[property]) # Handle rest of visible properties for property in ('name', 'game', 'wins', 'losses', 'credits', 'level', 'experience', 'blob'): dicty[property] = getattr(self, property) dicty['status'] = USER_VERIFY_MAP[self.status] return dicty