From b7aacd4212f05ed5de94d1f5c96c8312ce298662 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 19 Dec 2018 12:02:16 +0100 Subject: [PATCH] Fix support of kinto v12 --- CHANGELOG.rst | 3 ++- kinto_attachment/utils.py | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 735076a..043ac81 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,8 +4,9 @@ Changelog 6.1.0 (unreleased) ------------------ -- Nothing changed yet. +**Bug fixes** +- Fix support of kinto >= 12 6.0.0 (2018-10-02) ------------------ diff --git a/kinto_attachment/utils.py b/kinto_attachment/utils.py index 9fdc666..3bb0358 100644 --- a/kinto_attachment/utils.py +++ b/kinto_attachment/utils.py @@ -51,11 +51,10 @@ def sha256(content): def _object_uri(request, resource_name, matchdict, prefix): - route_name = '%s-record' % resource_name - full = request.route_path(route_name, **matchdict) - if not prefix: - return core_utils.strip_uri_prefix(full) - return full + uri = core_utils.instance_uri(request, resource_name=resource_name, **matchdict) + if prefix: + uri = f"/{request.registry.route_prefix}{uri}" + return uri def bucket_uri(request, prefix=False):