From 60a553803376681610c4a42e393ab23c492cbf38 Mon Sep 17 00:00:00 2001 From: Oliver Zander Date: Wed, 20 Aug 2025 11:19:05 +0200 Subject: [PATCH] set explicit library type choices --- input/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/models.py b/input/models.py index b065034..f4da70e 100755 --- a/input/models.py +++ b/input/models.py @@ -274,13 +274,15 @@ TYPE_CHOICES = { TYPE_VIS: type_link('E-Mail-Adressen_und_Visitenkarten#Visitenkarten', 'Visitenkarten'), } +LIBRARY_TYPES = TYPE_BIB, TYPE_ELIT, TYPE_SOFT +LIBRARY_TYPE_CHOICES = [(choice, TYPE_CHOICES[choice]) for choice in LIBRARY_TYPES] # same model is used for Library, ELitStip and Software! class Library(Grant): type = models.CharField( max_length=4, - choices=TYPE_CHOICES.items(), #attention: actually only BIB, ELIT, SOFT should be used here + choices=LIBRARY_TYPE_CHOICES, default='BIB', ) library = models.CharField(max_length=200)