Person+vouchers AttributeError 'tuple' object has no attribute 'append'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Curtis Hovey |
Bug Description
I broke applying vouchers. with a vocab change to permit any project to have a commercial subscription. A secondary change was to change the vocab to only return a resultset because it can be expensize converting all projects to a list. The TB suggests that the view's cache rules expect a list.
Module zope.app.
term = self.vocabulary
Module lp.registry.
for search_result in search_results:
Module lp.services.
self.pre_
Module lp.registry.
cache._
AttributeError: 'tuple' object has no attribute 'append'
Related branches
- j.c.sackett (community): Approve
-
Diff: 286 lines (+164/-24)5 files modifiedlib/lp/registry/browser/person.py (+21/-6)
lib/lp/registry/browser/tests/test_commercialsubscription.py (+96/-3)
lib/lp/registry/tests/test_commercialprojects_vocabularies.py (+21/-6)
lib/lp/registry/vocabularies.py (+10/-9)
lib/lp/testing/__init__.py (+16/-0)
tags: | added: commercial |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
tags: |
added: disclosure entitlement removed: commercial |
Oh This is about ProductLicense, not CommercialSubsc ription. +voucher has always had a performance problem because the saleforce voucher data is slow to collect, the data is cached. When a voucher is applied to add the commercial subscription to the projects, the view issues a next_url signal to itself to reload the data cached by setUpFields and SetUpWidgets. This breaks because I switched the Commercial Admin query to (not the query used by most users) use productset.search which is fast and has cached goodness. next_url is in conflict with the model cache which does not want to reload the object.
There are two paths to resolve the conflict. Clear the cache on the model, or clear the cache on the view. I favour the view because When a voucher is applied, the only data invalid in the form is the voucher in its vocab.