Merge lp:~dholbach/developer-ubuntu-com/queue-updates-1transaction into lp:developer-ubuntu-com
| Status: | Merged |
|---|---|
| Approved by: | David Callé on 2015-09-07 |
| Approved revision: | 140 |
| Merged at revision: | 145 |
| Proposed branch: | lp:~dholbach/developer-ubuntu-com/queue-updates-1transaction |
| Merge into: | lp:developer-ubuntu-com |
| Diff against target: |
184 lines (+51/-25) 1 file modified
developer_portal/management/commands/import-external-docs-branches.py (+51/-25) |
| To merge this branch: | bzr merge lp:~dholbach/developer-ubuntu-com/queue-updates-1transaction |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| David Callé | 2015-09-07 | Approve on 2015-09-07 | |
| Ubuntu App Developer site developers | 2015-09-04 | Pending | |
|
Review via email:
|
|||
Commit Message
Queue create/
This hopefully avoid writes in different developer.u.c app units.
Description of the Change
Queue create/
Change logging.ERROR to logging.DEBUG to see DB queries.
- 137. By Daniel Holbach on 2015-09-04
-
remove old Page.delete() statement
- 138. By Daniel Holbach on 2015-09-04
-
use db_actions.
remove_ page - 139. By Daniel Holbach on 2015-09-04
-
merge trunk
| Daniel Holbach (dholbach) wrote : | # |
| Daniel Holbach (dholbach) wrote : | # |
Some more explanation of what's happening:
Add a DBAction class with three methods: add_page() and remove_page() to add actions to the queue and run() to execute the actions. The queue uses a list, so the order is preserved (not that it should matter in our case).
The Page.objects.
The get_or_
For convenience, the call to .publish('en') is also moved into DBAction.run().
The constructors of the individual classes are all modified to pass our DBAction queue to all the places where it's required.
Hope that makes the review easier.
- 140. By Daniel Holbach on 2015-09-07
-
apply fix from David for the case where there are no pages in the database yet


Test data to use:
sqlite> select * from developer_ portal_ externaldocsbra nch; snapcraft| intro.md guides/ devel| guides/ current|
1|lp:snapcraft|snappy/
2|lp:snappy|snappy/
3|lp:snappy/15.04|snappy/
sqlite>