Skip to content

Commit

Permalink
Update lead_has_assessment in entry filter
Browse files Browse the repository at this point in the history
Use new assessment registry.
  • Loading branch information
Rup-Narayan-Rajbanshi authored and thenav56 committed Feb 5, 2024
1 parent bcc7ceb commit 23242b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apps/entry/filter_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions apps/entry/tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 23242b9

Please sign in to comment.