Fixed misuse of id name

This commit is contained in:
Joel Collins 2020-10-16 14:53:02 +01:00
parent 01539bef3e
commit b3332c078d
2 changed files with 8 additions and 8 deletions

View file

@ -105,10 +105,10 @@ for extension in find_extensions(OPENFLEXURE_EXTENSIONS_PATH):
labthing.add_view(views.CaptureList, "/captures") labthing.add_view(views.CaptureList, "/captures")
labthing.add_root_link(views.CaptureList, "captures") labthing.add_root_link(views.CaptureList, "captures")
labthing.add_view(views.CaptureView, "/captures/<id>") labthing.add_view(views.CaptureView, "/captures/<id_>")
labthing.add_view(views.CaptureDownload, "/captures/<id>/download/<filename>") labthing.add_view(views.CaptureDownload, "/captures/<id_>/download/<filename>")
labthing.add_view(views.CaptureTags, "/captures/<id>/tags") labthing.add_view(views.CaptureTags, "/captures/<id_>/tags")
labthing.add_view(views.CaptureAnnotations, "/captures/<id>/annotations") labthing.add_view(views.CaptureAnnotations, "/captures/<id_>/annotations")
# Attach settings and state resources # Attach settings and state resources
labthing.add_view(views.SettingsProperty, "/instrument/settings") labthing.add_view(views.SettingsProperty, "/instrument/settings")

View file

@ -49,18 +49,18 @@ class CaptureSchema(Schema):
def generate_links(self, data, **_): def generate_links(self, data, **_):
data.links = { data.links = {
"self": { "self": {
"href": url_for(CaptureView.endpoint, id=data.id, _external=True), "href": url_for(CaptureView.endpoint, id_=data.id, _external=True),
"mimetype": "application/json", "mimetype": "application/json",
**description_from_view(CaptureView), **description_from_view(CaptureView),
}, },
"tags": { "tags": {
"href": url_for(CaptureTags.endpoint, id=data.id, _external=True), "href": url_for(CaptureTags.endpoint, id_=data.id, _external=True),
"mimetype": "application/json", "mimetype": "application/json",
**description_from_view(CaptureTags), **description_from_view(CaptureTags),
}, },
"annotations": { "annotations": {
"href": url_for( "href": url_for(
CaptureAnnotations.endpoint, id=data.id, _external=True CaptureAnnotations.endpoint, id_=data.id, _external=True
), ),
"mimetype": "application/json", "mimetype": "application/json",
**description_from_view(CaptureAnnotations), **description_from_view(CaptureAnnotations),
@ -68,7 +68,7 @@ class CaptureSchema(Schema):
"download": { "download": {
"href": url_for( "href": url_for(
CaptureDownload.endpoint, CaptureDownload.endpoint,
id=data.id, id_=data.id,
filename=data.name, filename=data.name,
_external=True, _external=True,
), ),