diff --git a/HISTORY.rst b/HISTORY.rst index 94c476b6f4..77dd5ed73c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -14,6 +14,7 @@ - Add icons to the document face menu links. - Increase icon size by 10%. - Increase icon to text spacing to 3px. +- Make document type delete time period optional. 2.0.2 (2016-02-09) ================== diff --git a/mayan/apps/documents/migrations/0030_auto_20160309_1837.py b/mayan/apps/documents/migrations/0030_auto_20160309_1837.py new file mode 100644 index 0000000000..9712f700ed --- /dev/null +++ b/mayan/apps/documents/migrations/0030_auto_20160309_1837.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('documents', '0029_auto_20160122_0755'), + ] + + operations = [ + migrations.AlterField( + model_name='documenttype', + name='delete_time_period', + field=models.PositiveIntegerField(default=30, help_text='Amount of time after which documents of this type in the trash will be deleted.', null=True, verbose_name='Delete time period', blank=True), + ), + migrations.AlterField( + model_name='documenttype', + name='delete_time_unit', + field=models.CharField(default='days', choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes')], max_length=8, blank=True, null=True, verbose_name='Delete time unit'), + ), + ] diff --git a/mayan/apps/documents/models.py b/mayan/apps/documents/models.py index 782713c4e8..ab8b417b17 100644 --- a/mayan/apps/documents/models.py +++ b/mayan/apps/documents/models.py @@ -76,14 +76,15 @@ class DocumentType(models.Model): verbose_name=_('Trash time unit') ) delete_time_period = models.PositiveIntegerField( - default=DEFAULT_DELETE_PERIOD, help_text=_( + blank=True, default=DEFAULT_DELETE_PERIOD, help_text=_( 'Amount of time after which documents of this type in the trash ' 'will be deleted.' - ), verbose_name=_('Delete time period') + ), null=True, verbose_name=_('Delete time period') ) delete_time_unit = models.CharField( - choices=TIME_DELTA_UNIT_CHOICES, default=DEFAULT_DELETE_TIME_UNIT, - max_length=8, verbose_name=_('Delete time unit') + blank=True, choices=TIME_DELTA_UNIT_CHOICES, + default=DEFAULT_DELETE_TIME_UNIT, max_length=8, null=True, + verbose_name=_('Delete time unit') ) objects = DocumentTypeManager()