Opened 8 years ago

Closed 8 years ago

#9239 closed (wontfix)

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

Reported by: Malcolm Tredinnick Owned by: Malcolm Tredinnick
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.

Change History (7)

comment:1 Changed 8 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

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 8 years ago by Malcolm Tredinnick

Resolution: wontfixfixed

(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 8 years ago by Malcolm Tredinnick

(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 8 years ago by Malcolm Tredinnick

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

comment:5 Changed 8 years ago by rdakin

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

comment:6 Changed 8 years ago by Malcolm Tredinnick

Resolution: fixed
Status: closedreopened

Yes, it's still a wontfix.

comment:7 Changed 8 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: reopenedclosed
Note: See TracTickets for help on using tickets.
Back to Top