diff --git a/mail/views.py b/mail/views.py index c7789db7..5038841b 100644 --- a/mail/views.py +++ b/mail/views.py @@ -28,7 +28,11 @@ def post(self, request): data = request.data["licence"] except KeyError: errors = [{"licence": "This field is required."}] - + logger.error( + "Failed to create licence data for %s due to %s", + request.data, + errors, + ) return JsonResponse(status=status.HTTP_400_BAD_REQUEST, data={"errors": errors}) serializer_cls = self.get_serializer_cls(data["type"]) @@ -36,6 +40,11 @@ def post(self, request): if not serializer.is_valid(): errors = [{"licence": serializer.errors}] + logger.error( + "Failed to create licence data for %s due to %s", + data, + errors, + ) return JsonResponse(status=status.HTTP_400_BAD_REQUEST, data={"errors": errors}) if data["action"] == LicenceActionEnum.UPDATE: