Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/boto-619bdce661
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari authored Jan 9, 2024
2 parents 8ce9b1f + 50924ae commit d276916
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
9 changes: 7 additions & 2 deletions care/facility/api/viewsets/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def operate_assets(self, request, *args, **kwargs):
return Response({"result": result}, status=status.HTTP_200_OK)

except ValidationError as e:
return Response({"message": e.detail}, status=status.HTTP_400_BAD_REQUEST)
return Response({"detail": e.detail}, status=status.HTTP_400_BAD_REQUEST)

except KeyError as e:
return Response(
Expand All @@ -347,7 +347,12 @@ def operate_assets(self, request, *args, **kwargs):
)

except APIException as e:
return Response(e.detail, e.status_code)
return Response(
{
"detail": f"Communication with the middleware failed.\nReceived status code: {e.status_code}"
},
status=status.HTTP_502_BAD_GATEWAY,
)

except Exception as e:
print(f"error: {e}")
Expand Down
3 changes: 3 additions & 0 deletions care/users/api/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class Meta:
"first_name",
"last_name",
"email",
"video_connect_link",
"user_type",
"doctor_qualification",
"doctor_experience_commenced_on",
Expand Down Expand Up @@ -377,6 +378,7 @@ class Meta:
"home_facility_object",
"doctor_qualification",
"doctor_experience_commenced_on",
"video_connect_link",
"doctor_medical_council_registration",
"skills",
)
Expand Down Expand Up @@ -413,4 +415,5 @@ class Meta:
"last_login",
"home_facility_object",
"home_facility",
"video_connect_link",
)
17 changes: 17 additions & 0 deletions care/users/migrations/0011_user_video_connect_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.6 on 2023-12-26 17:51

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("users", "0010_rename_skills"),
]

operations = [
migrations.AddField(
model_name="user",
name="video_connect_link",
field=models.URLField(blank=True, null=True),
),
]
1 change: 1 addition & 0 deletions care/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class User(AbstractUser):
blank=True,
null=True,
)
video_connect_link = models.URLField(blank=True, null=True)

gender = models.IntegerField(choices=GENDER_CHOICES, blank=False)
age = models.IntegerField(validators=[MinValueValidator(1), MaxValueValidator(100)])
Expand Down
1 change: 1 addition & 0 deletions care/users/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_detail_representation(self, obj=None) -> dict:
"doctor_medical_council_registration": obj.doctor_medical_council_registration,
"doctor_qualification": obj.doctor_qualification,
"weekly_working_hours": obj.weekly_working_hours,
"video_connect_link": obj.video_connect_link,
**self.get_local_body_district_state_representation(obj),
}

Expand Down

0 comments on commit d276916

Please sign in to comment.