Skip to content

Commit bdb0be3

Browse files
committed
Add default op action for Patch
committer: Ralf Schlatterbeck <[email protected]>
1 parent a172277 commit bdb0be3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roundup/rest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ def patch_collection(self, class_name, input):
226226
raise Reject('PATCH a class is not allowed')
227227

228228
def patch_element(self, class_name, item_id, input):
229-
op = input['op'].value.lower()
229+
try:
230+
op = input['op'].value.lower()
231+
except KeyError:
232+
op = "replace"
230233
class_obj = self.db.getclass(class_name)
231234

232235
props = props_from_args(self.db, class_obj, input.value, item_id)

0 commit comments

Comments
 (0)