Esempio n. 1
0
 def get(self, request, *args, **kwargs):
     try:
         url = request.GET.get('emission_url')
         if not url:
             return erro_rest(('1321', 'Campo emission_url requerido'))  # TODO: codigo erro
         return Response({
             'email_list': comodo.get_emails_validacao(url)
         })
     except Exception:
         return erro_rest(('-1', 'Erro interno do servidor'))
Esempio n. 2
0
 def __init__(self, **kwargs):
     super(EmissaoNv3Tela2Form, self).__init__(**kwargs)
     choices_email = [(email, email) for email in get_emails_validacao(self.initial['emission_url'])]
     self.fields['emission_dcv_email'] = ChoiceField(choices=choices_email, widget=RadioSelect)