From 2c673514240d93c5a4431c98f87aafecb94bc081 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 5 Nov 2023 15:20:45 +0200 Subject: bugfix and making more robust --- core/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/forms.py') diff --git a/core/forms.py b/core/forms.py index 24beee4..5cbbe95 100644 --- a/core/forms.py +++ b/core/forms.py @@ -208,7 +208,9 @@ class EntranceLetterForm(ModelForm): Nb. The relationship between caves and entrances has historically been a many to many relationship. With entrances gaining new caves and letters when caves are joined. """ - entranceletter = forms.CharField(required=False, widget=forms.TextInput(attrs={"size": "2"})) + + # This only needs to be required=True for the second and subsequent entrances, not the first. Tricky. + entranceletter = forms.CharField(required=True, widget=forms.TextInput(attrs={"size": "2"})) class Meta: model = CaveAndEntrance -- cgit v1.2.3