Skip to content

Commit

Permalink
Fix data-admin-url model lookup for Django 1.8 ContentType
Browse files Browse the repository at this point in the history
Django 1.8 ContentType has changed the behaviour of "name" and
in some cases the previous version no longer returns a valid URL.
The correct parameter to use for the Model name is the "model"
parameter of the ContentType object.
  • Loading branch information
andrewyager authored and xrmx committed Sep 15, 2015
1 parent e71c299 commit 351dd4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_admin_bootstrapped/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def render_option(self, selected_choices, option_value, option_label):
extra_attrs = {
'data-generic-lookup-enabled': 'yes',
'data-admin-url': silent_reverse('admin:{0.app_label}_' \
'{0.name}_changelist'.format(ct)),
'{0.model}_changelist'.format(ct)),
}

if option_value in selected_choices:
Expand Down

0 comments on commit 351dd4a

Please sign in to comment.