Exemplo n.º 1
0
 def post(self):
     if self.arg.step == 'validate_phone_captcha':
         if self.get_secure_cookie('step') == '2':
             mt_log.info('validate_phone_captcha: get_secure_cookie_2')
             if validate_phone_captcha(self.arg.phone_captcha, self.arg.phone)['is_success']:
                 mt_log.info('validate_phone_captcha: captcha is right!')
                 self.set_secure_cookie('step', '3')
                 self.write({'is_success': True})
                 return
             else:
                 self.write({'is_success': False})
                 return
         else:
             self.write({'is_success': False, 'des': 'no step2'})
             return
         return
     elif self.arg.step == 'reset_password':
         if self.get_secure_cookie('step') == '3':
             response = modify_merchant_password(self.arg.shop_id, old_password=None,
                                                 new_password=self.arg.new_password,
                                                 need_old_password=False)
             self.clear_cookie('step')
             self.write(response)
             return
         else:
             self.write({'is_success': False, 'des': 'no step3'})
             return
     else:
         self.write({'is_success': False, 'res': 'error step!'})
         return
Exemplo n.º 2
0
 def post(self):
     mt_log.info(str(self.__class__) + str(self.arg))
     if len(self.arg.password) != 16 and len(self.arg.password) != 32:
         self.write(dict(error_code=MTERROR.PasswordCheckError.code, des=MTERROR.PasswordCheckError.des))
         return
     # exchange contact_phone_no and telephone_no
     response = sign_merchant(account=self.arg.account, password=self.arg.password,
                              contact_name=self.arg.contact_name,
                              contact_phone_no=self.arg.telephone_no, contact_email=self.arg.contact_email,
                              contact_qq=self.arg.contact_qq,
                              shop_name=self.arg.shop_name, brand_name=self.arg.brand_name,
                              business_hours=self.arg.business_hours,
                              telephone_no=self.arg.contact_phone_no, city_id=self.arg.city_id,
                              district_id=self.arg.district_id,
                              business_area=self.arg.business_area, address=self.arg.address,
                              longitude=self.arg.longitude,
                              latitude=self.arg.latitude, category_list=self.arg.category_list
                              )
     self.write(response)