Skip to content

Commit

Permalink
Change lead_has_assessment in entry filter to accept new assessment
Browse files Browse the repository at this point in the history
registry.
  • Loading branch information
Rup-Narayan-Rajbanshi committed Jan 31, 2024
1 parent bcc7ceb commit f02a591
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/entry/filter_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ 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
3 changes: 2 additions & 1 deletion apps/entry/tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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 +370,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 f02a591

Please sign in to comment.