Code

Opened 6 years ago

Closed 6 years ago

#6354 closed (fixed)

django.conf.urls.shortcut is unused code, and can be removed.

Reported by: tangerine Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: orphaned urls
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Just having a look in the urls package and it seems that django.urls.shortcut is unused by the rest of the codebase and hasn't even been compiled to a .pyc on my django checkout. A quick grep didn't turn up much so I though I'd mention it here in case it needs to be removed.

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Module in question is django.conf.urls.shortcut which appears to be leftover from the initial code import, rev [3].

comment:2 Changed 6 years ago by Simon Greenhill <dev@…>

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 6 years ago by Simon Greenhill <dev@…>

  • Summary changed from django.urls.shortcut to django.urls.shortcut is unused code, and can be removed.

comment:4 Changed 6 years ago by gwilson

  • Summary changed from django.urls.shortcut is unused code, and can be removed. to django.conf.urls.shortcut is unused code, and can be removed.

While it doesn't appear to be used in Django itself, it does still appear to be valid (the view it points to is still there). In fact, it appears that django.contrib.admin.urls could make use of it:

...
('^r/(\d+)/(.*)/$', 'django.views.defaults.shortcut'),
...

could be changed to:

('^r/', include('django.conf.urls.shortcut'),

after making the changes from [3009]. Looks like we might want to apply the [3009] changes to django.conf.urls.shortcut in case anyone is using it in their projects.

comment:5 Changed 6 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

(In [7040]) Fixed #6354 -- Fixed url in django/conf/urls/shortcut.py to work with non-integer primary keys (refs #2033) and made use of the URL file in the admin urls.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.