diff options
Diffstat (limited to 'pyblackbird_cc/resources/forms.py')
-rw-r--r-- | pyblackbird_cc/resources/forms.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pyblackbird_cc/resources/forms.py b/pyblackbird_cc/resources/forms.py index 5327def..f046969 100644 --- a/pyblackbird_cc/resources/forms.py +++ b/pyblackbird_cc/resources/forms.py @@ -25,7 +25,9 @@ ALLOWED_PDFS = 20 def _create_choices_tuple() -> list[tuple[str, str]]: """Returns a list of tuples containing resource subcategory names.""" - return sorted(list(ResourceSubcategory.objects.values_list("name", flat=True)), key=str) + vals = sorted(ResourceSubcategory.objects.values_list("name", flat=True), key=str) + out = tuple((x, x) for x in vals) + return out class ResourceCreateForm(forms.Form): @@ -34,6 +36,7 @@ class ResourceCreateForm(forms.Form): self.helper = FormHelper(self) self.helper.add_input(Submit("submit", "Submit")) self.fields["subcategories"].choices = _create_choices_tuple() + pass error_css_class = "error" required_css_class = "required" |