Use remove_private_keys() instead of popping predefined keys
This commit is contained in:
@@ -338,12 +338,8 @@ class Update(Resource):
|
||||
api = api or self.api
|
||||
attributes = attributes or self.to_dict()
|
||||
etag = attributes['_etag']
|
||||
attributes.pop('_id')
|
||||
attributes.pop('_etag')
|
||||
attributes.pop('_created')
|
||||
attributes.pop('_updated')
|
||||
attributes.pop('_links', None)
|
||||
attributes.pop('_deleted', None)
|
||||
|
||||
attributes = utils.remove_private_keys(attributes)
|
||||
attributes = utils.remove_none_attributes(attributes)
|
||||
url = utils.join_url(self.path, str(self['_id']))
|
||||
headers = utils.merge_dict(
|
||||
@@ -369,12 +365,7 @@ class Replace(Resource):
|
||||
api = api or self.api
|
||||
attributes = attributes or self.to_dict()
|
||||
etag = attributes['_etag']
|
||||
attributes.pop('_id')
|
||||
attributes.pop('_etag')
|
||||
attributes.pop('_created')
|
||||
attributes.pop('_updated')
|
||||
attributes.pop('_links', None)
|
||||
attributes.pop('_deleted', None)
|
||||
attributes = utils.remove_private_keys(attributes)
|
||||
if 'parent' in attributes:
|
||||
attributes.pop('parent')
|
||||
url = utils.join_url(self.path, str(self['_id']))
|
||||
|
||||
Reference in New Issue
Block a user