diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-22 19:11:36 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-22 19:13:04 +0100 |
commit | c9ceba85a9c0ba256edda865740c003bebd41428 (patch) | |
tree | 41b05d3effee612a7d1b5cf53621ff3a83bf70e4 | |
parent | 83654a35e3a23234e72c592380746244f60717ba (diff) | |
download | Ishtar-c9ceba85a9c0ba256edda865740c003bebd41428.tar.bz2 Ishtar-c9ceba85a9c0ba256edda865740c003bebd41428.zip |
🩹 document form: remove attachment constraint -> a document can be attached to none
-rw-r--r-- | ishtar_common/forms_common.py | 7 |
1 files changed, 1 insertions, 6 deletions
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): |