authopenid does not have is_usable set in context_processors.py

foxfirefey avatarfoxfirefey created an issue

I was getting this error when enabling this package's template loaders:

Environment:

Request Method: GET Request URL: http://memewidth.org/account/password/reset/ Django Version: 1.1 beta 1 SVN-10618 Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.flatpages', 'django.contrib.admin', 'django.contrib.admindocs', 'registration', 'django_authopenid', 'Accounts', 'Interests', 'Relationships', 'DataUpdates'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'django_authopenid.middleware.OpenIDMiddleware')

Traceback: File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, callback_kwargs) File "/usr/lib/python2.5/site-packages/django/contrib/auth/views.py" in password_reset 105. }, context_instance=RequestContext(request)) File "/usr/lib/python2.5/site-packages/django/shortcuts/init.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, kwargs), httpresponse_kwargs) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in render_to_string 103. t = get_template(template_name) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in get_template 81. source, origin = find_template_source(template_name) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in find_template_source 62. if not func.is_usable:

Exception Type: AttributeError at /account/password/reset/ Exception Value: 'function' object has no attribute 'is_usable'

It appears that this function should have is_usable set, as per advice here:

http://www.djangobook.com/en/2.0/chapter09/

And it gives an error otherwise. I've attached a patch that seems to fix this issue for me, but I'll admit that it might not follow good submission practices (I am inexperienced in generating and submitting Mercurial patches) and it might not be the best way to fix the problem either (I'm assuming it will always be usable, and I'm just blindly following the above example when it might be better laid out inside the class itself, etc).

Comments (2)

  1. foxfirefey

    My patch doesn't do enough--I've discovered that even with it, I get a different error:

    Environment:

    Request Method: GET Request URL: http://memewidth.org/admin/django_authopenid/userassociation/ Django Version: 1.1 beta 1 SVN-10618 Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.flatpages', 'django.contrib.admin', 'django.contrib.admindocs', 'registration', 'django_authopenid', 'Accounts', 'Interests', 'Relationships', 'DataUpdates'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'django_authopenid.middleware.OpenIDMiddleware')

    Traceback: File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, callback_kwargs) File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in wrapper 226. return self.admin_site.admin_view(view)(*args, kwargs) File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in inner 184. return view(request, *args, kwargs) File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in changelist_view 982. ], context, context_instance=template.RequestContext(request)) File "/usr/lib/python2.5/site-packages/django/shortcuts/init.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, kwargs), httpresponse_kwargs) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in render_to_string 101. t = select_template(template_name) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in select_template 114. return get_template(template_name) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in get_template 81. source, origin = find_template_source(template_name) File "/usr/lib/python2.5/site-packages/django/template/loader.py" in find_template_source 70. source, display_name = loader(name, dirs)

    Exception Type: TypeError at /admin/django_authopenid/userassociation/ Exception Value: authopenid() takes exactly 1 argument (2 given)

    And this one I am not so sure how to fix.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.