Skip to content

Commit

Permalink
fix accidentally creating preset in update preset
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Oct 3, 2024
1 parent aee281a commit a971edd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions care/facility/api/serializers/camera_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def validate(self, attrs):
msg = "Cannot have both position and a boundary."
raise ValidationError(msg)

Check warning on line 69 in care/facility/api/serializers/camera_preset.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/serializers/camera_preset.py#L68-L69

Added lines #L68 - L69 were not covered by tests

validated_data["asset_bed"] = self.get_asset_bed_obj()
return validated_data

Check warning on line 72 in care/facility/api/serializers/camera_preset.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/serializers/camera_preset.py#L71-L72

Added lines #L71 - L72 were not covered by tests

def create(self, validated_data):
validated_data["asset_bed"] = self.context["asset_bed"]
validated_data["created_by"] = self.context["request"].user
return super().create(validated_data)

Check warning on line 76 in care/facility/api/serializers/camera_preset.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/serializers/camera_preset.py#L75-L76

Added lines #L75 - L76 were not covered by tests

def update(self, instance, validated_data):
validated_data["updated_by"] = self.context["request"].user
return super().create(validated_data)
return super().update(instance, validated_data)

Check warning on line 80 in care/facility/api/serializers/camera_preset.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/serializers/camera_preset.py#L79-L80

Added lines #L79 - L80 were not covered by tests

0 comments on commit a971edd

Please sign in to comment.