Fix state patch api search by external id (#4495)

This commit is contained in:
Samuel Torres 2024-05-17 02:56:10 -07:00 committed by GitHub
parent f7ccf01426
commit 61e83ed808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -138,7 +138,7 @@ class StateAPIEndpoint(BaseAPIView):
serializer = StateSerializer(state, data=request.data, partial=True)
if serializer.is_valid():
if (
str(request.data.get("external_id"))
request.data.get("external_id")
and (state.external_id != str(request.data.get("external_id")))
and State.objects.filter(
project_id=project_id,