[yocto] [layerindex-web][PATCH] Redirect user to correct url after editing a layer

Paul Eggleton paul.eggleton at linux.intel.com
Thu Aug 17 02:56:45 PDT 2017


Hi Amanda,

Thanks - a few issues noted below.

On Tuesday, 15 August 2017 10:50:56 AM NZST Amanda Brindle wrote:
> Before, if a user edited a layer's name, they would be redirected
> to a url utilizing the old name and then receive a 404 Page not
> found error. Now, the url utilizes the new name.

Include here a reference to the bugzilla entry, typically like so:

Fixes [YOCTO #11932].

> Signed-off-by: Amanda Brindle <amanda.r.brindle at intel.com>
> ---
>  layerindex/views.py | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/layerindex/views.py b/layerindex/views.py
> index eaeb5c3..2a25455 100644
> --- a/layerindex/views.py
> +++ b/layerindex/views.py
> @@ -105,11 +105,6 @@ def edit_layer_view(request, template_name, branch='master', slug=None):
>          layerbranch = get_object_or_404(LayerBranch, layer=layeritem, branch=branchobj)
>          deplistlayers = LayerItem.objects.exclude(id=layeritem.id).order_by('name')
>          returnto = request.GET.get('returnto', 'layer_item')
> -        if returnto:
> -            if returnto == 'layer_review':
> -                return_url = reverse_lazy(returnto, args=(layeritem.name,))
> -            else:
> -                return_url = reverse_lazy(returnto, args=(branch, layeritem.name))

Moving this unfortunately breaks the return_url sent to the template on GET for the "Cancel" button, so I guess it needs to be set in both places.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list