Esempio n. 1
0
 def send_code(self, request):
     identity = self.get_identity(request)
     if identity:
         missive = use_twofactor(identity)
         if missive:
             device = missive.mode
             target = masking_email(
                 missive.target
             ) if device == choices.MODE_EMAIL else masking_phone(
                 missive.target)
             return {'mode': device, 'target': target}
     return {'error': 'not enable to send a code'}
Esempio n. 2
0
 def masking(self):
     return masking_email(self.email)
Esempio n. 3
0
 def masking_email(self):
     return masking_email(self.target)
Esempio n. 4
0
 def emails_masking(self):
     return [masking_email(email) for email in self.emails]