|
@ -7,6 +7,7 @@ from django.db import models |
|
|
from django.db.models import Max |
|
|
from django.db.models import Max |
|
|
from django.forms import ModelForm |
|
|
from django.forms import ModelForm |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
from datetime import datetime |
|
|
|
|
|
|
|
|
import crispy_layout_mixin |
|
|
import crispy_layout_mixin |
|
|
import sapl |
|
|
import sapl |
|
@ -52,6 +53,12 @@ class ProposicaoForm(ModelForm): |
|
|
raise ValidationError("Arquivo muito grande. ( > 5mb )") |
|
|
raise ValidationError("Arquivo muito grande. ( > 5mb )") |
|
|
return texto_original |
|
|
return texto_original |
|
|
|
|
|
|
|
|
|
|
|
def clean_data_envio(self): |
|
|
|
|
|
data_envio = self.cleaned_data.get('data_envio') |
|
|
|
|
|
if (not data_envio) and bool(self.initial): |
|
|
|
|
|
data_envio = datetime.now() |
|
|
|
|
|
return data_envio |
|
|
|
|
|
|
|
|
def clean(self): |
|
|
def clean(self): |
|
|
cleaned_data = self.cleaned_data |
|
|
cleaned_data = self.cleaned_data |
|
|
|
|
|
|
|
|