Opened 18 years ago

Closed 18 years ago

#4044 closed (fixed)

URLconf with prefix and callable views raises an exception

Reported by: wip@… Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Despite what the documentation for the URLconf says, having a prefix and callable views results in an exception.

This line here is the reasoning for it. prefix will resolve to True, so it then checks prefix concatenated with the view instead of skipping straight to passing the view. You can't concantenate a string and a function, so an exception is thrown.

Attachments (2)

url_defaults.patch (565 bytes ) - added by Vinay Sajip <vinay_sajip@…> 18 years ago.
Fix for incorrect handling of non-string views
url_defaults.2.patch (576 bytes ) - added by Vinay Sajip <vinay_sajip@…> 18 years ago.
Improved fix for incorrect handling of non-string views

Download all attachments as: .zip

Change History (5)

comment:1 by Simon G. <dev@…>, 18 years ago

Summary: URLconf with prefix and callable views.URLconf with prefix and callable views raises an exception
Triage Stage: UnreviewedAccepted

by Vinay Sajip <vinay_sajip@…>, 18 years ago

Attachment: url_defaults.patch added

Fix for incorrect handling of non-string views

comment:2 by Vinay Sajip <vinay_sajip@…>, 18 years ago

Has patch: set

by Vinay Sajip <vinay_sajip@…>, 18 years ago

Attachment: url_defaults.2.patch added

Improved fix for incorrect handling of non-string views

comment:3 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(In [5127]) Fixed #4044 -- Allowed callable views specifier to mix (i.e. not crash) with
prefix strings in URLConfs. Thanks, Vinay Sajip.

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