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
=== modified file 'desktopcouch/records/server_base.py'
--- desktopcouch/records/server_base.py 2009-11-17 17:40:39 +0000
+++ desktopcouch/records/server_base.py 2009-11-23 17:40:31 +0000
@@ -145,8 +145,7 @@
145 except ResourceNotFound:145 except ResourceNotFound:
146 return None146 return None
147 data = {}147 data = {}
148 if 'deleted' in couch_record.get('application_annotations', {}).get(148 if row_is_deleted(couch_record):
149 'Ubuntu One', {}).get('private_application_annotations', {}):
150 return None149 return None
151 data.update(couch_record)150 data.update(couch_record)
152 record = self.record_factory(data=data)151 record = self.record_factory(data=data)
@@ -194,8 +193,7 @@
194 if record_id not in self.db:193 if record_id not in self.db:
195 return False194 return False
196 record = self.db[record_id]195 record = self.db[record_id]
197 return 'deleted' not in record.get('application_annotations', {}).get(196 return not row_is_deleted(record)
198 'Ubuntu One', {}).get('private_application_annotations', {})
199197
200 def delete_view(self, view_name, design_doc=DEFAULT_DESIGN_DOCUMENT):198 def delete_view(self, view_name, design_doc=DEFAULT_DESIGN_DOCUMENT):
201 """Remove a view, given its name. Raises a KeyError on a unknown199 """Remove a view, given its name. Raises a KeyError on a unknown

Subscribers

People subscribed via source and target branches