From eeaa3c469b33e614941596a04d56af3be1290456 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 26 May 2024 14:41:07 +0100 Subject: wip: create form now as a feature field --- pyblackbird_cc/resources/forms.py | 7 ++++++- pyblackbird_cc/resources/tests/test_forms.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'pyblackbird_cc/resources') diff --git a/pyblackbird_cc/resources/forms.py b/pyblackbird_cc/resources/forms.py index b8b638c..9320a77 100644 --- a/pyblackbird_cc/resources/forms.py +++ b/pyblackbird_cc/resources/forms.py @@ -102,7 +102,12 @@ class ResourceCreateForm(forms.Form): ) pdf_files.widget.attrs.update({"class": "file_upload", "accept": ".pdf"}) thumbnail_files.widget.attrs.update({"class": "file_upload", "accept": ".png,.jpg"}) - feature_slot = forms.IntegerField(min_value=1, max_value=3, required=False) + feature_slot = forms.IntegerField( + min_value=1, + max_value=3, + required=False, + help_text="Please enter either 1, 2 or 3 here. This will dictate where on the page this resource will feature on the main list page.", + ) def clean_thumbnail_files(self): thumbnail_files = self.files.getlist("thumbnail_files") diff --git a/pyblackbird_cc/resources/tests/test_forms.py b/pyblackbird_cc/resources/tests/test_forms.py index e19784f..cea3540 100644 --- a/pyblackbird_cc/resources/tests/test_forms.py +++ b/pyblackbird_cc/resources/tests/test_forms.py @@ -71,5 +71,4 @@ class ResourceCreateFormTest(TestCase): "main_resource_category": self.resource_category.id, } form = ResourceCreateForm(data=form_data, files=self.form_files) - breakpoint() assert not form.is_valid() -- cgit v1.2.3