diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-22 19:11:36 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-04-16 16:42:32 +0200 |
commit | 61c0edd42c1c715621288ca37b25ea1b7f64a254 (patch) | |
tree | f4d11f94da1c35c5f3401fd6d1074a24dc22fd21 | |
parent | 5ed9985e6cda925bea64820fe0ccbad91c4eb6b9 (diff) | |
download | Ishtar-61c0edd42c1c715621288ca37b25ea1b7f64a254.tar.bz2 Ishtar-61c0edd42c1c715621288ca37b25ea1b7f64a254.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): |