From 61c0edd42c1c715621288ca37b25ea1b7f64a254 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 22 Feb 2024 19:11:36 +0100 Subject: 🩹 document form: remove attachment constraint -> a document can be attached to none MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/forms_common.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 81097ff2f..53a7f7d17 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -2350,12 +2350,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): "it is not corrupted." ) ) - for rel in models.Document.RELATED_MODELS: - if cleaned_data.get(rel, None): - return cleaned_data - raise forms.ValidationError( - _("A document has to be attached at least to one item") - ) + return cleaned_data def clean_publisher(self): if not self.cleaned_data.get("publisher", None): -- cgit v1.2.3