Code review comment for lp:~adiroiban/launchpad/bug-522188

Revision history for this message
Adi Roiban (adiroiban) wrote :

= Bug 522188 =
In the merge review for bug 340664, Curtis noted that the next_url for potemplate edit and admin forms is not using the referer address.

Below are his comments:

The behaviour of these actions is disconcerting. When I edit a a template,
the next_url is the template, but I expected to return to the all templates
view.

== Proposed fix ==
Use HTTP_REFERER in cancel_url and next_url

== Pre-implementation notes ==
In the merge review for bug 340664 Curtis suggested using HTTP_REFERER for cancel_url and next_url.

== Implementation details ==
Since the template edit and admin form are using the generic edit template, I have added the extra_info fill-slot there.

Please let me know if I should create a new template.

Since this looks like a generic behaviour, maybe we can have this implementation in LaunchpadForm and not in each class extending LaunchpadForm

== Tests ==
lp-test -t template-edit

== Demo and Q/A ==
Login as admin

1. Visit a series templates page: ie: https://translations.launchpad.dev/evolution/trunk/+templates

Click 'Edit' or 'Admin' link for a template.

On the form page, click Update or Cancel, it should lead you back to the templates page.

2. Directly access the edit page at https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2-test/+edit

Click Update or Cancel. It should lead you to the template index page. ie https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2-test

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/app/templates/generic-edit.pt
  lib/lp/translations/browser/potemplate.py
  lib/lp/translations/stories/standalone/xx-potemplate-edit.txt

« Back to merge proposal