From 3091dca729b607a8e31243d160cd6f2a2493d11e Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 2 Nov 2020 23:43:54 +0100 Subject: [PATCH] Fix : default value should be 0 --- .../migrations/0050_auto_20201102_2342.py | 40 +++++++++++++++++++ cotisations/models.py | 8 ---- 2 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 cotisations/migrations/0050_auto_20201102_2342.py diff --git a/cotisations/migrations/0050_auto_20201102_2342.py b/cotisations/migrations/0050_auto_20201102_2342.py new file mode 100644 index 00000000..9ab58611 --- /dev/null +++ b/cotisations/migrations/0050_auto_20201102_2342.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-11-02 22:42 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cotisations', '0049_auto_20201102_2305'), + ] + + operations = [ + migrations.AlterField( + model_name='article', + name='duration_connection', + field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in months)'), + preserve_default=False, + ), + migrations.AlterField( + model_name='article', + name='duration_days_connection', + field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in days, will be added to duration in months)'), + preserve_default=False, + ), + migrations.AlterField( + model_name='article', + name='duration_days_membership', + field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in days, will be added to duration in months)'), + preserve_default=False, + ), + migrations.AlterField( + model_name='article', + name='duration_membership', + field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in months)'), + preserve_default=False, + ), + ] diff --git a/cotisations/models.py b/cotisations/models.py index ac75760b..4963e0ad 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -704,26 +704,18 @@ class Article(RevMixin, AclMixin, models.Model): ) duration_membership = models.PositiveIntegerField( - blank=True, - null=True, validators=[MinValueValidator(0)], verbose_name=_("duration of the membership (in months)") ) duration_days_membership = models.PositiveIntegerField( - blank=True, - null=True, validators=[MinValueValidator(0)], verbose_name=_("duration of the membership (in days, will be added to duration in months)"), ) duration_connection = models.PositiveIntegerField( - blank=True, - null=True, validators=[MinValueValidator(0)], verbose_name=_("duration of the connection (in months)") ) duration_days_connection = models.PositiveIntegerField( - blank=True, - null=True, validators=[MinValueValidator(0)], verbose_name=_("duration of the connection (in days, will be added to duration in months)"), )