diff --git a/sapl/audiencia/migrations/0010_auto_20190219_1511.py b/sapl/audiencia/migrations/0010_auto_20190219_1511.py new file mode 100644 index 000000000..e3f9a046b --- /dev/null +++ b/sapl/audiencia/migrations/0010_auto_20190219_1511.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-02-19 18:11 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import sapl.utils + + +class Migration(migrations.Migration): + + dependencies = [ + ('audiencia', '0009_remove_anexoaudienciapublica_indexacao'), + ] + + operations = [ + migrations.AlterField( + model_name='anexoaudienciapublica', + name='arquivo', + field=models.FileField(default='Assunto não existente.', upload_to=sapl.utils.texto_upload_path, verbose_name='Arquivo'), + preserve_default=False, + ), + migrations.AlterField( + model_name='anexoaudienciapublica', + name='assunto', + field=models.TextField(verbose_name='Assunto'), + ), + migrations.AlterField( + model_name='anexoaudienciapublica', + name='data', + field=models.DateField(auto_now=True, default=django.utils.timezone.now), + preserve_default=False, + ), + ] diff --git a/sapl/audiencia/models.py b/sapl/audiencia/models.py index 684f27625..76c36c6c0 100755 --- a/sapl/audiencia/models.py +++ b/sapl/audiencia/models.py @@ -155,13 +155,12 @@ class AnexoAudienciaPublica(models.Model): audiencia = models.ForeignKey(AudienciaPublica, on_delete=models.PROTECT) arquivo = models.FileField( - blank=True, - null=True, upload_to=texto_upload_path, verbose_name=_('Arquivo')) - data = models.DateField(auto_now=timezone.now,blank=True, null=True) + data = models.DateField( + auto_now=timezone.now) assunto = models.TextField( - blank=True, verbose_name=_('Assunto')) + verbose_name=_('Assunto')) class Meta: verbose_name = _('Anexo de Documento Acessório') @@ -174,22 +173,19 @@ class AnexoAudienciaPublica(models.Model): if self.arquivo: self.arquivo.delete() - return models.Model.delete( - self, using=using, keep_parents=keep_parents) - - def save(self, force_insert=False, force_update=False, using=None, - update_fields=None): + return models.Model.delete(self, using=using, keep_parents=keep_parents) + def save(self, force_insert=False, force_update=False, using=None, update_fields=None): if not self.pk and self.arquivo: arquivo = self.arquivo self.arquivo = None - models.Model.save(self, force_insert=force_insert, - force_update=force_update, - using=using, - update_fields=update_fields) + models.Model.save( + self, + force_insert=force_insert, + force_update=force_update, + using=using, + update_fields=update_fields) self.arquivo = arquivo - return models.Model.save(self, force_insert=force_insert, - force_update=force_update, - using=using, - update_fields=update_fields) \ No newline at end of file + return models.Model.save(self, force_insert=force_insert, force_update=force_update, using=using, + update_fields=update_fields)