Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#537 closed defect (fixed)

Typo in patch committed to svn

Reported by: fonso Owned by: Adrian Holovaty
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: no UI/UX: no

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 19 years ago.

Download all attachments as: .zip

Change History (5)

by fonso, 19 years ago

Attachment: urlresolvers.patch added

comment:1 by fonso, 19 years ago

Summary: [patch] TypeError raisend in /<admin>/doc/views[patch] TypeError raised in /<admin>/doc/views

comment:2 by Jacob, 19 years ago

Resolution: fixed
Status: newclosed

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

comment:3 by Esaj, 19 years ago

Resolution: fixed
Status: closedreopened
Summary: [patch] TypeError raised in /<admin>/doc/viewsTypo 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 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: reopenedclosed

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

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