← Back to team overview

launchpad-dev team mailing list archive

Re: Best way to fix canonical_url

 

On Thu, 2010-08-19 at 07:25 +1200, Tim Penhey wrote:
> On Thu, 19 Aug 2010 07:08:30 Francis J. Lacoste wrote:
> > Hi,
> > 
> > I agree with Salgado, I don't think removing that checks is the right
> > solution.
> > 
> > And I don't really think there is a problem either. create_view and
> > create_initialized_view have a layer parameter. Why don't you use that
> > parametere?
> 
> It isn't just in unit tests, but in page tests too.
> 
> the TALES expression branch/fmt:link/+edit
> 
> gets converted to:
>   canonical_url(branch, view_name="+edit")
> 
> And we do use that type of TALES expression all over the place.
> 
> If that is on a bug page, then the current request implements the BugLayer.  
> With my new restrictive change, the +edit view isn't defined for the BugLayer, 
> so it blows up.
> 
> This is the guts of the problem, not the unit tests.

I see.  In that case, I'd be in favour of your second idea, or maybe
even a simple mapping of rootsites to layers.  Mostly because even
though the view check in canonical_url() is not doing the correct thing,
it still catches 404 links.

-- 
Guilherme Salgado <https://launchpad.net/~salgado>

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References