Skip to content

Commit

Permalink
prevent accidentally attempting to evaluate queryset early
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Oct 15, 2024
1 parent 3aa52e8 commit a6049ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions care/utils/queryset/asset_bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def get_asset_bed_queryset(user, queryset=None):
queryset = queryset or AssetBed.objects.all()
queryset = AssetBed.objects.all() if queryset is None else queryset

Check warning on line 7 in care/utils/queryset/asset_bed.py

View check run for this annotation

Codecov / codecov/patch

care/utils/queryset/asset_bed.py#L7

Added line #L7 was not covered by tests
if user.is_superuser:
pass

Check warning on line 9 in care/utils/queryset/asset_bed.py

View check run for this annotation

Codecov / codecov/patch

care/utils/queryset/asset_bed.py#L9

Added line #L9 was not covered by tests
elif user.user_type >= User.TYPE_VALUE_MAP["StateLabAdmin"]:
Expand All @@ -18,7 +18,7 @@ def get_asset_bed_queryset(user, queryset=None):


def get_bed_queryset(user, queryset=None):
queryset = queryset or Bed.objects.all()
queryset = Bed.objects.all() if queryset is None else queryset
if user.is_superuser:
pass
elif user.user_type >= User.TYPE_VALUE_MAP["StateLabAdmin"]:
Expand All @@ -32,7 +32,7 @@ def get_bed_queryset(user, queryset=None):


def get_asset_queryset(user, queryset=None):
queryset = queryset or Asset.objects.all()
queryset = Asset.objects.all() if queryset is None else queryset
if user.is_superuser:
pass

Check warning on line 37 in care/utils/queryset/asset_bed.py

View check run for this annotation

Codecov / codecov/patch

care/utils/queryset/asset_bed.py#L37

Added line #L37 was not covered by tests
elif user.user_type >= User.TYPE_VALUE_MAP["StateLabAdmin"]:
Expand Down

0 comments on commit a6049ff

Please sign in to comment.