Skip to content

Commit

Permalink
Fixed default mapping when lambda function called (#8250)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Aug 1, 2024
1 parent e0da3a2 commit f3dcc3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20240801_104929_boris_fixed_default_mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- API call to run automatic annotations fails on a model with attributes
when mapping not provided in the request (<https://github.com/cvat-ai/cvat/pull/8250>)
4 changes: 2 additions & 2 deletions cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ def make_default_mapping(model_labels, task_labels):
if task_label.name == model_label['name'] and labels_compatible(model_label, task_label):
attributes_default_mapping = {}
for model_attr in model_label.get('attributes', {}):
for db_attr in model_label.attributespec_set.all():
for db_attr in task_label.attributespec_set.all():
if db_attr.name == model_attr['name']:
attributes_default_mapping[model_attr] = db_attr.name
attributes_default_mapping[model_attr['name']] = db_attr.name

mapping_by_default[model_label['name']] = {
'name': task_label.name,
Expand Down

0 comments on commit f3dcc3e

Please sign in to comment.