duplicate code and late evaluation doing translator license checks
Bug #531720 reported by
Jeroen T. Vermeulen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Ian Booth |
Bug Description
Right now we have a smörgåsbord of places in the code that check for a person's relicensing agreement: canAddSuggestions checks twice, canEditTranslations calls canAddSuggestions then checks twice itself; then there's POFileBaseView.
So this information is queried from the database lots of times. The +translate page for n messages seems to query it 4n+1 times. It'd be nice if we could sweep these together a bit and cache them where possible (i.e. in browser code—launchbag perhaps?).
Related branches
lp:~wallyworld/launchpad/translator-licence-checks-531720
- William Grant (community): Approve (code)
-
Diff: 82 lines (+15/-6)2 files modifiedlib/lp/translations/browser/pofile.py (+5/-5)
lib/lp/translations/model/translationsperson.py (+10/-1)
tags: | added: cleanup |
tags: |
added: tech-debt removed: cleanup |
Changed in rosetta: | |
status: | Incomplete → Triaged |
importance: | Undecided → High |
Changed in launchpad: | |
status: | Triaged → In Progress |
assignee: | nobody → Ian Booth (wallyworld) |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I believe it's actually happening only a constant number of times. I've just checked and query was executed exactly 3 times on https:/ /translations. edge.launchpad. net/ubuntu/ lucid/+ source/ checkbox/ +pots/checkbox/ sr/+translate/ ++oops+ +
What makes you think it's an actual problem?