Skip to content

Commit ffd02e3

Browse files
authored
Merge pull request #316 from Mosquito-Alert/api_atomic_report_photo
Made endpoint Report with photos atomic on create
2 parents 09f227e + 04f8561 commit ffd02e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

api/serializers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ class Meta:
736736
class BaseReportWithPhotosSerializer(BaseReportSerializer):
737737
photos = SimplePhotoSerializer(required=True, many=True)
738738

739+
@transaction.atomic
739740
def create(self, validated_data):
740741
photos = validated_data.pop("photos", [])
741742

0 commit comments

Comments
 (0)