Django

Code

Ticket #4044 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

URLconf with prefix and callable views raises an exception

Reported by: wip@rpgmaker.net Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

url_defaults.patch (0.6 kB) - added by Vinay Sajip <vinay_sajip@yahoo.co.uk> on 04/20/07 11:02:11.
Fix for incorrect handling of non-string views
url_defaults.2.patch (0.6 kB) - added by Vinay Sajip <vinay_sajip@yahoo.co.uk> on 04/20/07 11:34:12.
Improved fix for incorrect handling of non-string views

Change History

04/14/07 18:44:34 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • summary changed from URLconf with prefix and callable views. to URLconf with prefix and callable views raises an exception.
  • needs_tests changed.
  • needs_docs changed.

04/20/07 11:02:11 changed by Vinay Sajip <vinay_sajip@yahoo.co.uk>

  • attachment url_defaults.patch added.

Fix for incorrect handling of non-string views

04/20/07 11:02:40 changed by Vinay Sajip <vinay_sajip@yahoo.co.uk>

  • has_patch set to 1.

04/20/07 11:34:12 changed by Vinay Sajip <vinay_sajip@yahoo.co.uk>

  • attachment url_defaults.2.patch added.

Improved fix for incorrect handling of non-string views

04/29/07 04:41:46 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4044 (URLconf with prefix and callable views raises an exception)




Change Properties
Action