Skip to content

Commit

Permalink
feat: remove language fixture, Taxonomy.required, make allow_multiple…
Browse files Browse the repository at this point in the history
… True by default
  • Loading branch information
bradenmacdonald committed Oct 4, 2023
1 parent 5de0969 commit 946df48
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 1,415 deletions.
File renamed without changes.
7 changes: 0 additions & 7 deletions openedx_tagging/core/tagging/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def create_taxonomy(
name: str,
description: str | None = None,
enabled=True,
required=False,
allow_multiple=False,
allow_free_text=False,
taxonomy_class: type[Taxonomy] | None = None,
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 946df48

Please sign in to comment.