Merge lp://qastaging/~mandel/desktopcouch/record_exists into lp://qastaging/desktopcouch

Proposed by Manuel de la Peña
Status: Merged
Approved by: Chad Miller
Approved revision: not available
Merged at revision: not available
Proposed branch: lp://qastaging/~mandel/desktopcouch/record_exists
Merge into: lp://qastaging/desktopcouch
Diff against target: 23 lines (+2/-4)
1 file modified
desktopcouch/records/server_base.py (+2/-4)
To merge this branch: bzr merge lp://qastaging/~mandel/desktopcouch/record_exists
Reviewer Review Type Date Requested Status
Chad Miller (community) Approve
Review via email: mp+15167@code.qastaging.launchpad.net

Commit message

Ensures that the method that test for the presence of the record does not just check if the field is present but ensures the value is correct.

To post a comment you must log in.
Revision history for this message
Chad Miller (cmiller) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktopcouch/records/server_base.py'
2--- desktopcouch/records/server_base.py 2009-11-17 17:40:39 +0000
3+++ desktopcouch/records/server_base.py 2009-11-23 17:40:31 +0000
4@@ -145,8 +145,7 @@
5 except ResourceNotFound:
6 return None
7 data = {}
8- if 'deleted' in couch_record.get('application_annotations', {}).get(
9- 'Ubuntu One', {}).get('private_application_annotations', {}):
10+ if row_is_deleted(couch_record):
11 return None
12 data.update(couch_record)
13 record = self.record_factory(data=data)
14@@ -194,8 +193,7 @@
15 if record_id not in self.db:
16 return False
17 record = self.db[record_id]
18- return 'deleted' not in record.get('application_annotations', {}).get(
19- 'Ubuntu One', {}).get('private_application_annotations', {})
20+ return not row_is_deleted(record)
21
22 def delete_view(self, view_name, design_doc=DEFAULT_DESIGN_DOCUMENT):
23 """Remove a view, given its name. Raises a KeyError on a unknown

Subscribers

People subscribed via source and target branches