diff --git a/base/middleware.py b/base/middleware.py index cdb3e1243..6bd7cddb7 100644 --- a/base/middleware.py +++ b/base/middleware.py @@ -5,6 +5,7 @@ middleware.py from django.apps import apps from django.db.models import Q from django.http import HttpResponse, HttpResponseNotAllowed +from django.shortcuts import render from base.context_processors import AllCompany from base.horilla_company_manager import HorillaCompanyManager @@ -110,58 +111,5 @@ class MethodNotAllowedMiddleware: def __call__(self, request): response = self.get_response(request) if isinstance(response, HttpResponseNotAllowed): - html_content = """ - - - - - - Method Not Allowed - - - -
-

405 Method Not Allowed

-

The request method is not allowed. Please make sure you are sending a proper request.

- Go Back to Home -
- - - """ - return HttpResponse(html_content, content_type="text/html", status=405) + return render(request, "405.html") return response