Opened 7 years ago

Closed 4 years ago

#7032 closed Cleanup/optimization (needsinfo)

change django.core.handlers.base.get_response to use urlresolvers.resolve

Reported by: tclineks Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.core.handlers.base.get_response looks like it should use urlresolvers.resolve instead of directly instantiating urlresolvers.RegexURLResolver

Index: django/core/handlers/base.py
===================================================================
--- django/core/handlers/base.py        (revision 7425)
+++ django/core/handlers/base.py        (working copy)
@@ -68,9 +68,8 @@
         # Get urlconf from request object, if available.  Otherwise use default.
         urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
 
-        resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
         try:
-            callback, callback_args, callback_kwargs = resolver.resolve(request.path)
+            callback, callback_args, callback_kwargs = urlresolvers.resolve(request.path, urlconf)
 
             # Apply view middleware
             for middleware_method in self._view_middleware:

Change History (7)

comment:1 Changed 7 years ago by ericholscher

  • milestone set to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by jacob

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 7 years ago by jacob

Is there actually a bug here? Because "looks like it should ..." isn't a good enough reason to change verified working code.

comment:4 Changed 7 years ago by jacob

  • Triage Stage changed from Accepted to Design decision needed

comment:5 Changed 7 years ago by jacob

  • milestone 1.0 deleted

I don't see a bug here, so pushing post-1.0.

comment:6 Changed 4 years ago by lukeplant

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:7 Changed 4 years ago by Alex

  • Easy pickings unset
  • Resolution set to needsinfo
  • Status changed from new to closed
  • UI/UX unset

I don't see a reason to do this, besides a desire for code churn ;). Closing needsinfo, feel free to reopen if there's a reason I missed.

Note: See TracTickets for help on using tickets.
Back to Top