Skip to content
Snippets Groups Projects
Commit d917db9a authored by Jacek Lebioda's avatar Jacek Lebioda Committed by Valentin Grouès
Browse files

feat: make document's notes an optional field

parent 08f65e6d
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2.8 on 2020-01-30 10:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_document_expiry_date'),
]
operations = [
migrations.AlterField(
model_name='document',
name='content_notes',
field=models.TextField(blank=True, null=True, verbose_name='Document Notes'),
),
]
......@@ -49,7 +49,7 @@ class Document(CoreModel):
content = models.FileField(upload_to=get_file_name)
content_url = models.URLField(verbose_name='Document Url', null=True, blank=True)
content_notes = models.TextField(verbose_name='Document Notes',
blank=False,
blank=True,
null=True)
domain_type = models.TextField(verbose_name='Domain Type', choices=type, default=type.not_specified)
......@@ -76,4 +76,4 @@ class Document(CoreModel):
@receiver(post_delete, sender=Document, dispatch_uid='document_delete')
def document_cleanup(sender, instance, **kwargs):
if hasattr(instance.content, 'path') and os.path.exists(instance.content.path):
default_storage.delete(instance.content.path)
\ No newline at end of file
default_storage.delete(instance.content.path)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment