On limite à 3 caractères la taille de l'abbréviation

This commit is contained in:
Tom Hubrecht 2021-04-17 21:30:37 +02:00
parent bd968d55c1
commit f7763e2e92
2 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,20 @@
# Generated by Django 3.2 on 2021-04-17 19:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("elections", "0023_option_abbreviation"),
]
operations = [
migrations.AlterField(
model_name="option",
name="abbreviation",
field=models.CharField(
blank=True, max_length=3, verbose_name="abbréviation"
),
),
]

View file

@ -137,7 +137,7 @@ class Option(models.Model):
Question, related_name="options", on_delete=models.CASCADE
)
text = TranslatedFieldWithFallback(models.TextField(_("texte"), blank=False))
abbreviation = models.CharField(_("abbréviation"), max_length=8, blank=True)
abbreviation = models.CharField(_("abbréviation"), max_length=3, blank=True)
winner = models.BooleanField(_("option gagnante"), default=False)
voters = models.ManyToManyField(