From 639aab7eb7afd4e92e3b0639b046749428cc1589 Mon Sep 17 00:00:00 2001 From: himanshu-sharmav Date: Tue, 5 Nov 2024 07:29:45 +0000 Subject: [PATCH] changed indendation for linter test --- care/facility/api/serializers/prescription.py | 12 ++++++++---- care/facility/tests/test_prescriptions_api.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/care/facility/api/serializers/prescription.py b/care/facility/api/serializers/prescription.py index b6c4939ffd..af64cd84b8 100644 --- a/care/facility/api/serializers/prescription.py +++ b/care/facility/api/serializers/prescription.py @@ -1,3 +1,5 @@ +import re + from django.shortcuts import get_object_or_404 from django.utils import timezone from rest_framework import serializers @@ -9,7 +11,6 @@ PrescriptionDosageType, ) from care.users.api.serializers.user import UserBaseMinimumSerializer -import re class MedibaseMedicineSerializer(serializers.ModelSerializer): @@ -100,8 +101,9 @@ class Meta: def validate(self, attrs): def extract_numeric_value(dosage): - - match = re.match(r"(\d+(\.\d+)?)", dosage) # Matches digits and optional decimal part + match = re.match( + r"(\d+(\.\d+)?)", dosage + ) # Matches digits and optional decimal part if match: return float(match.group(1)) return None @@ -147,7 +149,9 @@ def extract_numeric_value(dosage): # Raise error if max_dosage is less than base_dosage if max_dosage_value < base_dosage_value: raise serializers.ValidationError( - {"max_dosage": "Max dosage in 24 hours should be greater than or equal to base dosage."} + { + "max_dosage": "Max dosage in 24 hours should be greater than or equal to base dosage." + } ) if attrs.get("dosage_type") == PrescriptionDosageType.PRN: diff --git a/care/facility/tests/test_prescriptions_api.py b/care/facility/tests/test_prescriptions_api.py index 19ff522133..a235d9aca1 100644 --- a/care/facility/tests/test_prescriptions_api.py +++ b/care/facility/tests/test_prescriptions_api.py @@ -312,5 +312,5 @@ def test_max_dosage_less_than_base_dosage(self): self.assertIn("max_dosage", response.data) self.assertEqual( response.data["max_dosage"][0], - "Max dosage in 24 hours should be greater than or equal to base dosage." + "Max dosage in 24 hours should be greater than or equal to base dosage.", )