Skip to content

Commit

Permalink
Fix value check for taxonomy and choices
Browse files Browse the repository at this point in the history
  • Loading branch information
triklozoid committed Dec 11, 2024
1 parent 16ec173 commit 43ed0ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions label_studio/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ def get_config_suitable_for_bulk_annotation(project):
per_item = tag.attr.get('perItem', 'false').lower() == 'true'
if per_region or per_item:
return False

Check warning on line 148 in label_studio/projects/serializers.py

View check run for this annotation

Codecov / codecov/patch

label_studio/projects/serializers.py#L148

Added line #L148 was not covered by tests
# For ChoicesTag and TaxonomyTag, value must be "no"
# For ChoicesTag and TaxonomyTag, the value attribute must not be set at all
if tag_class in [ChoicesTag, TaxonomyTag]:
value = tag.attr.get('value', '').lower()
if value != 'no':
if 'value' in tag.attr:
return False

# For TaxonomyTag, check labeling and apiUrl
Expand Down

0 comments on commit 43ed0ee

Please sign in to comment.