Skip to content

Commit

Permalink
feat: Remove Taxonomy.required, make allow_multiple True by default […
Browse files Browse the repository at this point in the history
…FC-0030] (#91)
  • Loading branch information
bradenmacdonald authored Oct 6, 2023
1 parent 2439f64 commit 909e3f8
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 1,418 deletions.
2 changes: 1 addition & 1 deletion openedx_learning/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Open edX Learning ("Learning Core").
"""
__version__ = "0.2.0"
__version__ = "0.2.1"
9 changes: 1 addition & 8 deletions openedx_tagging/core/tagging/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def create_taxonomy(
name: str,
description: str | None = None,
enabled=True,
required=False,
allow_multiple=False,
allow_multiple=True,
allow_free_text=False,
taxonomy_class: type[Taxonomy] | None = None,
) -> Taxonomy:
Expand All @@ -38,7 +37,6 @@ def create_taxonomy(
name=name,
description=description or "",
enabled=enabled,
required=required,
allow_multiple=allow_multiple,
allow_free_text=allow_free_text,
)
Expand Down Expand Up @@ -213,11 +211,6 @@ def _check_new_tag_count(new_tag_count: int) -> None:
if not taxonomy.allow_multiple and len(tags) > 1:
raise ValueError(_(f"Taxonomy ({taxonomy.name}) only allows one tag per object."))

if taxonomy.required and len(tags) == 0:
raise ValueError(
_(f"Taxonomy ({taxonomy.id}) requires at least one tag per object.")
)

current_tags = list(
ObjectTagClass.objects.filter(taxonomy=taxonomy, object_id=object_id)
)
Expand Down
Loading

0 comments on commit 909e3f8

Please sign in to comment.