From 23242b9ba02d1a3c937c91262bdea176788e4260 Mon Sep 17 00:00:00 2001 From: rup-narayan-rajbanshi Date: Wed, 31 Jan 2024 11:55:22 +0545 Subject: [PATCH] Update lead_has_assessment in entry filter Use new assessment registry. --- apps/entry/filter_set.py | 3 +-- apps/entry/tests/test_schemas.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/entry/filter_set.py b/apps/entry/filter_set.py index dad0ba5cf7..a7f813752f 100644 --- a/apps/entry/filter_set.py +++ b/apps/entry/filter_set.py @@ -648,8 +648,7 @@ def lead_group_label_filter(self, queryset, name, value): def lead_has_assessment_filter(self, qs, _, value): if value is None: return qs - # TODO: We need to add new assessment module filter here after it is deployed - return qs.filter(lead__assessment__isnull=not value) + return qs.filter(lead__assessmentregistry__isnull=not value) def authoring_organization_types_filter(self, qs, name, value): if value: diff --git a/apps/entry/tests/test_schemas.py b/apps/entry/tests/test_schemas.py index b3c85e39f4..b4a49b2265 100644 --- a/apps/entry/tests/test_schemas.py +++ b/apps/entry/tests/test_schemas.py @@ -9,11 +9,11 @@ from user.factories import UserFactory from geo.factories import RegionFactory, AdminLevelFactory, GeoAreaFactory from project.factories import ProjectFactory -from ary.factories import AssessmentFactory from lead.factories import LeadFactory from entry.factories import EntryFactory, EntryAttributeFactory from analysis_framework.factories import AnalysisFrameworkFactory, WidgetFactory from organization.factories import OrganizationFactory, OrganizationTypeFactory +from assessment_registry.factories import AssessmentRegistryFactory from quality_assurance.factories import EntryReviewCommentFactory from lead.tests.test_schemas import TestLeadQuerySchema @@ -369,7 +369,7 @@ def test_entry_query_filter(self): project=project, analysis_framework=af, lead=lead4, entry_type=Entry.TagType.EXCERPT, controlled=False) # For assessment filters - AssessmentFactory.create(project=project, lead=lead1) + AssessmentRegistryFactory.create(project=project, lead=lead1) # create entry review comment for entry EntryReviewCommentFactory(entry=entry1_1, created_by=user, comment_type=EntryReviewComment.CommentType.COMMENT)