diff --git a/preferences/migrations/0056_optionalprinter_code_duration.py b/preferences/migrations/0056_optionalprinter_code_duration.py new file mode 100644 index 00000000..2ccb85a0 --- /dev/null +++ b/preferences/migrations/0056_optionalprinter_code_duration.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-11-29 21:50 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0055_generaloption_main_site_url'), + ] + + operations = [ + migrations.AddField( + model_name='optionalprinter', + name='code_duration', + field=models.DurationField(default=datetime.timedelta(1), help_text='Digicode max duration for printer'), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index 6e2699f3..11b9cb74 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -589,7 +589,7 @@ class MailMessageOption(AclMixin, models.Model): verbose_name = _("email message options") -class OptionalPrinter(AclMixin, models.Model): +class OptionalPrinter(AclMixin, PreferencesModel): """Preference for Printer app""" Printer_enabled = models.BooleanField( @@ -669,6 +669,11 @@ class OptionalPrinter(AclMixin, models.Model): default=0.0, ) + code_duration = models.DurationField( + default=timedelta(days=1), + help_text=_("Digicode max duration for printer") + ) + permissions = ( ("view_optionalprinter", _("Can view the printer options")), ) diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index 24a7d001..182c0a05 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -382,6 +382,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,