feat: only fetch the location if none is given

This commit is contained in:
2025-05-24 13:06:23 +02:00
parent cacfeff3fe
commit cc2a659767

View File

@@ -215,6 +215,7 @@ class RescueOrganizationApiView(APIView):
serializer = RescueOrganizationSerializer(data=request.data, context={"request": request}) serializer = RescueOrganizationSerializer(data=request.data, context={"request": request})
if serializer.is_valid(): if serializer.is_valid():
rescue_org = serializer.save() rescue_org = serializer.save()
if rescue_org.location is None:
# Add the location # Add the location
post_rescue_org_save.delay_on_commit(rescue_org.pk) post_rescue_org_save.delay_on_commit(rescue_org.pk)
return Response( return Response(