Opened 6 years ago

Closed 6 years ago

#19406 closed Bug (needsinfo)

Lacking named groups in urlpatterns of admin causes NoReverseMatch

Reported by: liokmkoil@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


As described in

urlresolvers.reverse('admin:cards_card_change', args=[92])

could get the URL successfully, however the following cannot

urlresolvers.reverse('admin:cards_card_change', kwargs={'object_id':92})

The lacking of named groups in urlpattern causes the inconsistent behavior

        urlpatterns = patterns('',
                name='%s_%s_history' % info),
                name='%s_%s_delete' % info),
                name='%s_%s_change' % info),

Both history_view, delete_view and change_view accept object_id, thus we could replace r'^(.+)...' to r'^(?P<object_id>.+)...' to fix the problem.

Change History (1)

comment:1 Changed 6 years ago by Ramiro Morales

Resolution: needsinfo
Status: newclosed

What do you mean with 'inconsistent behavior'? these three views have been documented as accepting positional arguments since 1.1. See the examples in the documentation sction you've linked from the StackOverfolw question: . Please reopen if you can provide an actual use case because of which we'd need to change it now.

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