Skip to content

Commit

Permalink
Merge pull request #1396 from the-deep/fix/test-fail
Browse files Browse the repository at this point in the history
Mock DeepL in assisted_tagging test
  • Loading branch information
thenav56 authored Dec 21, 2023
2 parents d98368a + 04fda4e commit e4b60d0
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 61 deletions.
2 changes: 1 addition & 1 deletion apps/analysis/dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class AnalysisTopicModelClusterEntryLoader(DataLoaderWithContext):
def batch_load_fn(self, keys):
qs = TopicModelCluster.entries.through.objects.filter(
topicmodelcluster__in=keys,
).select_related('entry').order_by('topicmodelcluster', 'entry')
).select_related('entry').order_by('topicmodelcluster', 'entry_id')
_map = defaultdict(list)
for cluster_entry in qs:
_map[cluster_entry.topicmodelcluster_id].append(cluster_entry.entry)
Expand Down
4 changes: 2 additions & 2 deletions apps/assisted_tagging/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _get_existing_tags_by_tagid():
assisted_tag.group = tag_meta.get('group')
assisted_tag.is_category = tag_meta['is_category']
assisted_tag.hide_in_analysis_framework_mapping = tag_meta['hide_in_analysis_framework_mapping']
if assisted_tag.id:
if assisted_tag.pk:
updated_tags.append(assisted_tag)
else:
assisted_tag.tag_id = tag_id
Expand All @@ -54,8 +54,8 @@ def _get_existing_tags_by_tagid():
updated_tags,
fields=(
'name',
'is_category',
'group',
'is_category',
'hide_in_analysis_framework_mapping',
)
)
Expand Down
Loading

0 comments on commit e4b60d0

Please sign in to comment.