示例#1
0
 def put_pw_recover_email(self, netid, email, edate):
     """
     Updates recover email info in netid's profile
     """
     profile = Profile()
     profile.recover_email = email
     profile.recover_email_date = edate
     return self.put_pw_recover_info(netid, profile)
示例#2
0
 def put_pw_recover_sms(self, netid, sms, sdate):
     """
     Updates recover sms info in netid's profile
     """
     profile = Profile()
     profile.recover_sms = sms
     profile.recover_sms_date = sdate
     return self.put_pw_recover_info(netid, profile)
示例#3
0
 def _pw_recover_from_json(self, data):
     info = json.loads(data)['profile'][0]
     ret = Profile()
     if 'validid' in info:
         ret.validid = info['validid']
     if 'recover_contacts' in info:
         ret.recover_contacts = info['recover_contacts']
     if 'recover_block_reasons' in info:
         ret.recover_block_reasons = info['recover_block_reasons']
     return ret
示例#4
0
 def _pw_recover_from_json(self, data):
     info = json.loads(data)['profile'][0]
     ret = Profile()
     if 'validid' in info:
         ret.validid = info['validid']
     if 'recover_email' in info:
         ret.recover_email = info['recover_email']
     if 'recover_email_date' in info:
         ret.recover_email_date = info['recover_email_date']
     if 'recover_sms' in info:
         ret.recover_sms = info['recover_sms']
     if 'recover_sms_date' in info:
         ret.recover_sms_date = info['recover_sms_date']
     if 'recover_block_code' in info:
         ret.recover_block_code = info['recover_block_code']
     return ret