From 367c68ad6fe4b599c3978290c68f7027e00ba09f Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 18 Dec 2018 16:27:14 +0000 Subject: [PATCH] Fixed capture URL in JSON --- openflexure_microscope/api/v1/blueprints/camera/capture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openflexure_microscope/api/v1/blueprints/camera/capture.py b/openflexure_microscope/api/v1/blueprints/camera/capture.py index 5fe959cc..be4f113c 100644 --- a/openflexure_microscope/api/v1/blueprints/camera/capture.py +++ b/openflexure_microscope/api/v1/blueprints/camera/capture.py @@ -180,12 +180,12 @@ class CaptureAPI(MicroscopeView): # TODO: Tidy up adding URI to metadata # Add API routes to returned metadata uri_dict = { - 'uri': {'metadata': '{}/{}'.format(url_for(self), capture_id)} + 'uri': {'metadata': '{}'.format(url_for('.capture', capture_id=capture_obj.id))} } # If available, also add download link if capture_metadata['available']: - uri_dict['uri']['download'] = '{}/{}/download/{}'.format(url_for(self), capture_obj.id, capture_obj.filename) + uri_dict['uri']['download'] = '{}download/{}'.format(url_for('.capture', capture_id=capture_obj.id), capture_obj.filename) capture_metadata.update(uri_dict)