From 14d9fc04d190bdc0f56b8ff034bad445a147e489 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Fri, 19 Oct 2018 01:21:40 +0200 Subject: [PATCH] Stronger bdd validation for studentcards --- counter/migrations/0017_studentcard.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/counter/migrations/0017_studentcard.py b/counter/migrations/0017_studentcard.py index 963f77db..8304a104 100644 --- a/counter/migrations/0017_studentcard.py +++ b/counter/migrations/0017_studentcard.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.13 on 2018-10-17 23:02 +# Generated by Django 1.11.13 on 2018-10-18 23:15 from __future__ import unicode_literals +import django.core.validators from django.db import migrations, models import django.db.models.deletion @@ -25,7 +26,12 @@ class Migration(migrations.Migration): ), ( "uid", - models.CharField(max_length=14, unique=True, verbose_name="uid"), + models.CharField( + max_length=14, + unique=True, + validators=[django.core.validators.MinLengthValidator(4)], + verbose_name="uid", + ), ), ( "customer",