Skip to content

Commit

Permalink
undo changes for removing leases with null decisions MVJ-8
Browse files Browse the repository at this point in the history
  • Loading branch information
toorhamza committed Sep 13, 2023
1 parent ce40856 commit 1ce88d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 2 additions & 4 deletions leasing/tests/api/test_lease_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
@pytest.mark.parametrize("value", ["A1128-1", " A1128-1", "A1128-1 ", " A1128-1 "])
@pytest.mark.parametrize("param_name", ["search", "identifier"])
def test_search_finds_one_lease_by_full_identifier(
django_db_setup, admin_client, lease_factory, decision_factory, value, param_name
django_db_setup, admin_client, lease_factory, value, param_name
):
lease = lease_factory(
type_id=1, municipality_id=1, district_id=29, notice_period_id=1
)
decision_factory(lease_id=lease.id)
lease_factory(type_id=1, municipality_id=1, district_id=1, notice_period_id=1)

response = admin_client.get(reverse("lease-list"), data={param_name: value})
Expand All @@ -25,12 +24,11 @@ def test_search_finds_one_lease_by_full_identifier(
@pytest.mark.django_db
@pytest.mark.parametrize("param_name", ["search", "identifier"])
def test_search_finds_one_lease_by_full_identifier_where_type_has_two_letters(
django_db_setup, admin_client, lease_factory, decision_factory, param_name
django_db_setup, admin_client, lease_factory, param_name
):
lease = lease_factory(
type_id=33, municipality_id=1, district_id=1, notice_period_id=1
)
decision_factory(lease_id=lease.id)
lease_factory(type_id=33, municipality_id=1, district_id=2, notice_period_id=1)

response = admin_client.get(reverse("lease-list"), data={param_name: "MA100-1"})
Expand Down
3 changes: 0 additions & 3 deletions leasing/viewsets/lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@ def get_queryset(self): # noqa: C901
)
)

# filtering all leases with no decisions
queryset = queryset.filter(decisions__isnull=False)

return queryset.distinct()

def get_serializer_class(self):
Expand Down

0 comments on commit 1ce88d6

Please sign in to comment.