in kinto-remote-settings/src/kinto_remote_settings/signer/updater.py [0:0]
def _update_source_attributes(self, request, **kwargs):
parent_id = "/buckets/%s" % self.source["bucket"]
resource_name = "collection"
collection_record = self.storage.get(
parent_id=parent_id,
resource_name=resource_name,
object_id=self.source["collection"],
)
# Update the collection_record
new_collection = dict(**collection_record)
new_collection.update(**kwargs)
# Remove last_modified to be sure it's bumped.
new_collection.pop("last_modified", None)
updated = self.storage.update(
parent_id=parent_id,
resource_name=resource_name,
object_id=self.source["collection"],
obj=new_collection,
)
matchdict = dict(bucket_id=self.source["bucket"], id=self.source["collection"])
notify_resource_event(
request,
{"method": "PUT", "path": self.source_collection_uri},
matchdict=matchdict,
resource_name="collection",
parent_id=self.source_bucket_uri,
obj=updated,
action=ACTIONS.UPDATE,
old=collection_record,
)