Code

Opened 6 years ago

Closed 5 years ago

#9239 closed (wontfix)

Better reverse() handling for the (.*) pattern

Reported by: mtredinnick Owned by: mtredinnick
Component: Core (Other) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Right now, if you have (.*) in a URL pattern, calling reverse() or {% url... %} requires you to pass in an empty string argument. But this is really an optional argument, since it successfully matches nothing. It would be nice if reverse URL resolving understood that case and allowed for no parameter to be passed in.

Attachments (0)

Change History (7)

comment:1 Changed 6 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Now that I look at the code, this would be unnecessarily fiddly to handle. We currently can completely ignore the contents of capturing groups and having to process them just for a few special cases would be extra work for no huge benefit.

Turns out that (.*)? would work as a pattern if somebody didn't want to have to pass in empty arguments. So wontfix-ing my own ticket, upon reflection.

comment:2 Changed 6 years ago by mtredinnick

  • Resolution changed from wontfix to fixed

(In [9217]) Fixed #9239 -- Somebody read my form validation docs from r9177 and found a
typo in them. I guess that was predictable. Thanks, Berry Groenendijk

comment:3 Changed 6 years ago by mtredinnick

(In [9218]) [1.0.X] Fixed #9239 -- Somebody read my form validation docs from r9180 and
found a typo in them. I guess that was predictable. Thanks, Berry Groenendijk

Backport of r9217 from trunk.

comment:4 Changed 6 years ago by mtredinnick

Above commit messages were typos. They should have referred to bug #9329.

comment:5 Changed 5 years ago by rdakin

Does that mean this should still be resolved wontfix? The issue is still apparent in my testing.

comment:6 Changed 5 years ago by mtredinnick

  • Resolution fixed deleted
  • Status changed from closed to reopened

Yes, it's still a wontfix.

comment:7 Changed 5 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from reopened to closed

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.