Skip to content

Commit

Permalink
Merge branch 'develop' into sainak/feat/ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Sep 22, 2024
2 parents 37f7880 + 22a91f9 commit b40ba60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 1 addition & 2 deletions care/facility/api/viewsets/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ def filter_by_diagnoses(self, queryset, name, value):
)

def filter_by_has_consents(self, queryset, name, value: str):

if not value:
return queryset

Expand Down Expand Up @@ -805,7 +804,7 @@ class PatientSearchViewSet(ListModelMixin, GenericViewSet):
"facility",
"allow_transfer",
"is_active",
)
).order_by("id")
serializer_class = PatientSearchSerializer
permission_classes = (IsAuthenticated, DRYPermissions)
pagination_class = PatientSearchSetPagination
Expand Down
18 changes: 10 additions & 8 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from decimal import Decimal

from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import JSONField
Expand Down Expand Up @@ -158,7 +160,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(95), MaxValueValidator(106)],
validators=[MinValueValidator(Decimal(95)), MaxValueValidator(Decimal(106))],
)
spo2 = models.DecimalField(
max_digits=4, decimal_places=2, blank=True, null=True, default=None
Expand Down Expand Up @@ -324,7 +326,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(0), MaxValueValidator(30)],
validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(30))],
)
ventilator_pip = models.IntegerField(
default=None,
Expand Down Expand Up @@ -395,7 +397,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(0), MaxValueValidator(10)],
validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(10))],
)
pco2 = models.IntegerField(
default=None,
Expand All @@ -413,7 +415,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(5), MaxValueValidator(80)],
validators=[MinValueValidator(Decimal(5)), MaxValueValidator(Decimal(80))],
)
base_excess = models.IntegerField(
default=None,
Expand All @@ -426,23 +428,23 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(0), MaxValueValidator(20)],
validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(20))],
)
sodium = models.DecimalField(
decimal_places=2,
max_digits=5,
blank=True,
default=None,
null=True,
validators=[MinValueValidator(100), MaxValueValidator(170)],
validators=[MinValueValidator(Decimal(100)), MaxValueValidator(Decimal(170))],
)
potassium = models.DecimalField(
decimal_places=2,
max_digits=4,
blank=True,
default=None,
null=True,
validators=[MinValueValidator(1), MaxValueValidator(10)],
validators=[MinValueValidator(Decimal(1)), MaxValueValidator(Decimal(10))],
)
blood_sugar_level = models.IntegerField(
default=None,
Expand All @@ -455,7 +457,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
blank=True,
default=None,
null=True,
validators=[MinValueValidator(0), MaxValueValidator(100)],
validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(100))],
)
insulin_intake_frequency = models.IntegerField(
choices=InsulinIntakeFrequencyType.choices,
Expand Down
2 changes: 1 addition & 1 deletion care/facility/tests/test_pdf_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_compile_typ(data):
class TestTypstInstallation(TestCase):
def test_typst_installed(self):
try:
subprocess.run(["typst", "--version"], check=True)
subprocess.run(["typst", "--version"], check=True, capture_output=True)
typst_installed = True
except subprocess.CalledProcessError:
typst_installed = False
Expand Down

0 comments on commit b40ba60

Please sign in to comment.