From f4b6f10d1e3437edc3e07c79e7045c62cc6ae8e5 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Mon, 21 Jan 2019 00:08:53 +0100 Subject: [PATCH] attribut name unique --- .../migrations/0040_auto_20190120_1708.py | 20 +++++++++++++++++++ cotisations/models.py | 5 +++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 cotisations/migrations/0040_auto_20190120_1708.py diff --git a/cotisations/migrations/0040_auto_20190120_1708.py b/cotisations/migrations/0040_auto_20190120_1708.py new file mode 100644 index 00000000..b7f5b279 --- /dev/null +++ b/cotisations/migrations/0040_auto_20190120_1708.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2019-01-20 23:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cotisations', '0039_documenttemplate'), + ] + + operations = [ + migrations.AlterField( + model_name='documenttemplate', + name='name', + field=models.CharField(max_length=125, unique=True, verbose_name='name'), + ), + ] diff --git a/cotisations/models.py b/cotisations/models.py index d7178f20..88407d33 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -967,8 +967,9 @@ class DocumentTemplate(RevMixin, AclMixin, models.Model): verbose_name=_('template') ) name = models.CharField( - max_length=255, - verbose_name=_('name') + max_length=125, + verbose_name=_('name'), + unique=True ) class Meta: