Opened 14 years ago

Closed 14 years ago

#8327 closed (invalid)

link to change password form on 'change user' page in admin interface is broken

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


Go into the admin interface, open a user, and try to change its password.


Request Method: GET
Request URL: http://localhost:8000/bradmin/auth/user/9/password/
Django Version: 1.0-alpha_2-SVN-8351
Python Version: 2.5.2
Installed Applications:
Installed Middleware:

File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/core/handlers/" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/contrib/admin/" in root
  172.                 return self.model_page(request, *url.split('/', 2))
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/views/decorators/" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/contrib/admin/" in model_page
  189.         return admin_obj(request, rest_of_url)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/contrib/admin/" in __call__
  275.             return self.change_view(request, unquote(url))
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/" in _commit_on_success
  238.                 res = func(*args, **kw)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/contrib/admin/" in change_view
  616.             obj = model._default_manager.get(pk=object_id)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/" in get
  81.         return self.get_query_set().get(*args, **kwargs)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/" in get
  294.         clone = self.filter(*args, **kwargs)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/" in filter
  481.         return self._filter_or_exclude(False, *args, **kwargs)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/" in _filter_or_exclude
  499.             clone.query.add_q(Q(*args, **kwargs))
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/sql/" in add_q
  1166.                         can_reuse=used_aliases)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/sql/" in add_filter
  1113.         self.where.add((alias, col, field, lookup_type, value), connector)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/sql/" in add
  48.                 params = field.get_db_prep_lookup(lookup_type, value)
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/fields/" in get_db_prep_lookup
  214.             return [self.get_db_prep_value(value)]
File "/home/tobias/caktus/eclipse-workspace/blueridge_visit_database/django/db/models/fields/" in get_db_prep_value
  439.         return int(value)

Exception Type: ValueError at /bradmin/auth/user/9/password/
Exception Value: invalid literal for int() with base 10: '9/password'

Change History (6)

comment:1 Changed 14 years ago by Brian Rosner

I can't reproduce this. Are you doing any admin modification with regards to UserAdmin or templates?

comment:2 Changed 14 years ago by Tobias McNulty

nope. I don't know what UserAdmin is, so I'm assuming not, and I definitely haven't created any templates for the admin interface. It seems like maybe the URL parsing is broken? Like there should be a (\d+) somewhere, but there's a (\w+) instead? I'm using 8351.

comment:3 Changed 14 years ago by Tobias McNulty

on closer examination, the change password link in the "default" (?) admin ( works, but the link in my custom admin does not.

comment:4 Changed 14 years ago by Brian Rosner

Ah, see now we are getting somewhere. Can you show your code for your AdminSite?

comment:5 Changed 14 years ago by Tobias McNulty

bradmin = admin.AdminSite()

class UserAdmin(admin.ModelAdmin):
	fields = ('first_name', 'last_name', 'email', 'password', 'groups', 'last_login', 'date_joined')
	list_display = ('last_name', 'first_name', 'email', 'last_login')
	search_fields = ('email', 'first_name', 'last_name',)
	list_filter = ('groups',)
	ordering = ('last_name',)
bradmin.register(User, UserAdmin)

class SiteAdmin(admin.ModelAdmin):
	search_fields = ('name',)
bradmin.register(visitdb.Site, SiteAdmin)


class TeamAdmin(admin.ModelAdmin):
	fields = ('physician', 'members')
	search_fields = ('physician', 'members')
bradmin.register(visitdb.Team, TeamAdmin)

comment:6 Changed 14 years ago by Brian Rosner

Resolution: invalid
Status: newclosed

Ok. Yep there is your problem. And you *do* know what a UserAdmin is. You are trying to replace it! :) Make sure when you replace the UserAdmin that you properly subclass django.contrib.auth.admin.UserAdmin and not just admin.ModelAdmin.

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