merge with vespa version
[cascardo/eventmanager.git] / forms.py
index 78be2d9..1f10f13 100644 (file)
--- a/forms.py
+++ b/forms.py
@@ -142,6 +142,15 @@ class InscricaoBase(LoginBase):
 class Inscricao(InscricaoBase):
     inscricao_comercial = forms.BooleanField(required=False,
         label='Inscrição Comercial')
+    cpf_cnpj = forms.CharField(max_length=20, required=False, label='CPF/CNPJ',
+        help_text='Somente necessário para a inscrição comercial')
+
+    def clean_cpf_cnpj(self):
+        cpf_cnpj = self.cleaned_data['cpf_cnpj']
+        if self.cleaned_data['inscricao_comercial'] and not cpf_cnpj:
+            raise ValidationError('Você escolheu a inscrição comercial, '
+                    'portanto este campo se torna obrigatório')
+        return cpf_cnpj
 
 class InscricaoCaravana(InscricaoBase):
     lista_nomes = forms.CharField(label='Lista de nomes',
@@ -160,7 +169,7 @@ class Boleto(forms.Form):
     # Field names are in mixedCase because of bb's sistem request =/
     idConv = forms.CharField(max_length=6, initial='303366',
             widget=HiddenInput())
-    refTran = forms.CharField(max_length=17, initial='14581970000000002',
+    refTran = forms.CharField(max_length=17,
             widget=HiddenInput())
     tpPagamento = forms.CharField(max_length=2, initial='21',
             widget=HiddenInput())