diff --git a/website/views/project.py b/website/views/project.py index d64530d92..9b5682185 100644 --- a/website/views/project.py +++ b/website/views/project.py @@ -1008,16 +1008,24 @@ def get_issue_count(full_name, query, headers): except requests.RequestException as e: return JsonResponse( - {"status": "error", "message": "Network error: A network error occurred. Please try again later."}, status=503 + { + "status": "error", + "message": "Network error: A network error occurred. Please try again later.", + }, + status=503, ) except requests.HTTPError as e: return JsonResponse( - {"status": "error", "message": "A GitHub API error occurred. Please try again later."}, + { + "status": "error", + "message": "A GitHub API error occurred. Please try again later.", + }, status=e.response.status_code, ) except ValueError as e: return JsonResponse( - {"status": "error", "message": "There was an error processing your data."}, status=400 + {"status": "error", "message": "There was an error processing your data."}, + status=400, ) elif section == "metrics": @@ -1127,16 +1135,24 @@ def get_issue_count(full_name, query, headers): except requests.RequestException as e: return JsonResponse( - {"status": "error", "message": "Network error: A network error occurred. Please try again later."}, status=503 + { + "status": "error", + "message": "Network error: A network error occurred. Please try again later.", + }, + status=503, ) except requests.HTTPError as e: return JsonResponse( - {"status": "error", "message": "A GitHub API error occurred. Please try again later."}, + { + "status": "error", + "message": "A GitHub API error occurred. Please try again later.", + }, status=e.response.status_code, ) except ValueError as e: return JsonResponse( - {"status": "error", "message": "There was an error processing your data."}, status=400 + {"status": "error", "message": "There was an error processing your data."}, + status=400, ) return super().post(request, *args, **kwargs)