From 33be20b8a93f53efea4f739ef09d23ae58d315c5 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 26 May 2020 11:33:30 -0700 Subject: [PATCH] Remove urlconf handling in proxito middleware --- readthedocs/proxito/middleware.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/readthedocs/proxito/middleware.py b/readthedocs/proxito/middleware.py index 50cf96e4ac2..9f179583c0f 100644 --- a/readthedocs/proxito/middleware.py +++ b/readthedocs/proxito/middleware.py @@ -167,28 +167,6 @@ def process_request(self, request): # noqa # Otherwise set the slug on the request request.host_project_slug = request.slug = ret - try: - project = Project.objects.get(slug=request.host_project_slug) - except Project.DoesNotExist: - log.exception('No host_project_slug set on project') - return None - - # This is hacky because Django wants a module for the URLConf, - # instead of also accepting string - if project.urlconf: - - # Stop Django from caching URLs - project_timestamp = project.modified_date.strftime("%Y%m%d.%H%M%S") - url_key = f'readthedocs.urls.fake.{project.slug}.{project_timestamp}' - - log.info( - 'Setting URLConf: project=%s url_key=%s urlconf=%s', - project, url_key, project.urlconf, - ) - if url_key not in sys.modules: - sys.modules[url_key] = project.proxito_urlconf - request.urlconf = url_key - return None def process_response(self, request, response): # noqa