From 58de45134a87fa94f64be4cbb7cda4e36d806306 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 10 Apr 2023 13:41:17 -0400 Subject: [PATCH] paperwork: Disallow empty certification definition names --- ...tificationdefinition_certification_name.py | 20 +++++++++++++++++++ paperwork/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 paperwork/migrations/0013_alter_certificationdefinition_certification_name.py diff --git a/paperwork/migrations/0013_alter_certificationdefinition_certification_name.py b/paperwork/migrations/0013_alter_certificationdefinition_certification_name.py new file mode 100644 index 0000000..fbb3100 --- /dev/null +++ b/paperwork/migrations/0013_alter_certificationdefinition_certification_name.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2 on 2023-04-10 17:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("paperwork", "0012_waiveraudit_certificationaudit"), + ] + + operations = [ + migrations.AlterField( + model_name="certificationdefinition", + name="certification_name", + field=models.CharField( + db_column="Certification Name", default="", max_length=255 + ), + preserve_default=False, + ), + ] diff --git a/paperwork/models.py b/paperwork/models.py index 7ea1d85..53e05aa 100644 --- a/paperwork/models.py +++ b/paperwork/models.py @@ -107,7 +107,7 @@ class CertificationDefinition(models.Model): db_column="Certification Identifier", primary_key=True ) certification_name = models.CharField( - db_column="Certification Name", max_length=255, blank=True, null=True + db_column="Certification Name", max_length=255 ) department = models.ForeignKey(Department, models.PROTECT)