Exemplo 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'}
Exemplo n.º 2
0
 def masking(self):
     return masking_phone(self.phone)
Exemplo n.º 3
0
 def masking_phone(self):
     return masking_phone(self.target)
Exemplo n.º 4
0
 def phones_masking(self):
     return [masking_phone(phone) for phone in self.phones]