Merge lp://qastaging/~adiroiban/launchpad/bug-475435 into lp://qastaging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Данило Шеган | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11176 | ||||
Proposed branch: | lp://qastaging/~adiroiban/launchpad/bug-475435 | ||||
Merge into: | lp://qastaging/launchpad | ||||
Diff against target: |
300 lines (+74/-58) 5 files modified
lib/canonical/launchpad/security.py (+15/-7) lib/lp/translations/browser/potemplate.py (+6/-7) lib/lp/translations/model/potemplate.py (+1/-1) lib/lp/translations/stories/standalone/xx-series-templates.txt (+30/-22) lib/lp/translations/templates/object-templates.pt (+22/-21) |
||||
To merge this branch: | bzr merge lp://qastaging/~adiroiban/launchpad/bug-475435 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Данило Шеган (community) | Approve | ||
Review via email: mp+29889@code.qastaging.launchpad.net |
Commit message
Reduce the usage of URL formatters on +templates page in order to avoid timeouts.
Description of the change
= Bug 475435 =
+template page times out on pages with more than 100 templates
== Proposed fix ==
* reduce the amount of SQL queries
* reduce the usage of URL formatters
== Pre-implementation notes ==
I have discussed with Danilo at LP Epic and he agreed with using "hardcoded" link instead of URL formatters for admin links.
== Implementation details ==
Since the metal:fill-
I have removed the language_count, since they are not really that important and are adding more queries. If this branch solve the timeout problem, we might consider adding the language count again.
To easy the review process I plan to fix the lint errors after the review is done, since those warnings were not introduces by the changes from this branch.
== Tests ==
./bin/test -t xx-series-
== Demo and Q/A ==
Testing is a bit difficult since the problem appears only when there are many templates.
On lp.dev you should add more than 1000 templates to a distribution series and then access
https:/
The page should load in less than 10 seconds.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
833: W291 trailing whitespace
833: Line has trailing whitespace.
./lib/lp/
71: want exceeds 78 characters.
73: want exceeds 78 characters.
87: source exceeds 78 characters.
89: want exceeds 78 characters.
93: source exceeds 78 characters.
95: want exceeds 78 characters.
102: source exceeds 78 characters.
104: want exceeds 78 characters.
108: source exceeds 78 characters.
110: want exceeds 78 characters.
190: want exceeds 78 characters.
191: want exceeds 78 characters.
192: want exceeds 78 characters.
Things we agreed on in live discussion (for reference): edit_permission should be determined in initialize() once, based on context, not on first template; name should be more appropriate as well ("can_edit_ templates" ?) translations" as well for launchpad. TranslationsAdm in permission emplates so we get it all with one query.
* template_
* we should have "can_admin_
* it would be nice if we can get languages back in the table; we'd have to insert a count() in the get*Templates call on HasTranslationT