Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#537 closed defect (fixed)

Typo in patch committed to svn

Reported by: fonso Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

There's been an error:

Traceback (most recent call last):

  File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/base.py", line 64, in get_response
    response = callback(request, **param_dict)

  File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/views/admin/doc.py", line 104, in view_index
    view_functions = extract_views_from_urlpatterns(urlconf.urlpatterns)

  File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/views/admin/doc.py", line 300, in extract_views_from_urlpatterns
    raise TypeError, "%s does not appear to be a urlpattern object" % p

TypeError: <django.core.urlresolvers.RegexURLResolver object at 0x408a84ec> does not appear to be a urlpattern object

A patch (also attached):

Index: django/core/urlresolvers.py
===================================================================
--- django/core/urlresolvers.py	(revision 661)
+++ django/core/urlresolvers.py	(working copy)
@@ -78,6 +78,10 @@
             return self._urlconf_module
     urlconf_module = property(_get_urlconf_module)
 
+    def _get_url_patterns(self):
+        return self.urlconf_module.urlpatterns
+    url_patterns = property(_get_url_patterns)
+
     def _resolve_special(self, view_type):
         callback = getattr(self.urlconf_module, 'handler%s' % view_type)
         mod_name, func_name = get_mod_func(callback)

Attachments (1)

urlresolvers.patch (615 bytes) - added by fonso 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by fonso

comment:1 Changed 10 years ago by fonso

  • Summary changed from [patch] TypeError raisend in /<admin>/doc/views to [patch] TypeError raised in /<admin>/doc/views

comment:2 Changed 10 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [718]) Fixed #537; thanks, fonso

comment:3 Changed 10 years ago by Esaj

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from [patch] TypeError raised in /<admin>/doc/views to Typo in patch committed to svn

I think there's been a typo in the code committed to svn. It should be

return self.urlconf_module.urlpatterns

not

return self.urlconf_module.patterns

comment:4 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [719]) Fixed #537 -- Fixed typo in [718]. Thanks, Esaj

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