Skip to content

django52: Model instances passed to related filters must be saved. #37220

@awais786

Description

@awais786

pytest lms/djangoapps/instructor_task/tests/test_tasks_helper.py::TestTeamGradeReport::test_team_deleted


value = <CourseTeam id=None team_id=team-0 team_size=1 topic_id=topic-0 course_id=course-v1:org.0+course_0+Run_0>, lhs = Col(teams_courseteammembership, teams.CourseTeamMembership.team)

    def get_normalized_value(value, lhs):
        from django.db.models import Model

        if isinstance(value, Model):
            if not value._is_pk_set():
>               raise ValueError("Model instances passed to related filters must be saved.")
E               ValueError: Model instances passed to related filters must be saved.

../venvs/edxapp/lib/python3.11/site-packages/django/db/models/fields/related_lookups.py:20: ValueError

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions