fix(devops): Only track checkin if no other error occured

ref: #678 #676
This commit is contained in:
2025-03-15 03:33:47 +09:30
parent 3888ab737b
commit b8281a3dd7

View File

@ -144,12 +144,17 @@ class ViewSet(PublicReadOnlyViewSet):
response.headers['Last-Modified'] = self.last_modified.strftime('%a, %d %b %Y %H:%M:%S %z')
if(
response.status_code == 200
or response.status_code == 304
): # Only save check-in if no other error occured.
CheckIn.objects.create(
organization_id = self.kwargs['organization_id'],
software_id = self.kwargs['software_id'],
deployment_id = request.headers.get('client-id', 'not-provided'),
feature = 'feature_flag',
)
CheckIn.objects.create(
organization_id = self.kwargs['organization_id'],
software_id = self.kwargs['software_id'],
deployment_id = request.headers.get('client-id', 'not-provided'),
feature = 'feature_flag',
)
return response