Skip to content

Commit

Permalink
Merge pull request #128 from will-moore/final_fixes
Browse files Browse the repository at this point in the history
Final bug fixes
  • Loading branch information
sbesson committed Nov 23, 2015
2 parents f8081cf + 6ab6053 commit befa276
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion static/figure/3rdparty/shape-editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Built on 2015-11-04
//! Built on 2015-11-14
//! GPL License. www.openmicroscopy.org

//! DO NOT EDIT THIS FILE! - Edit under src/js/*.js
Expand Down Expand Up @@ -501,6 +501,9 @@ var CreateArrow = function CreateArrow(options) {
strokeWidth = this.manager.getStrokeWidth(),
zoom = this.manager.getZoom();

this.startX = startX;
this.startY = startY;

this.line = new Arrow({
'manager': this.manager,
'paper': this.paper,
Expand Down
26 changes: 14 additions & 12 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,20 @@ def list_web_figures(request, conn=None, **kwargs):

rsp.append(figFile)

# remove image Ids if images deleted (to prevent 404 for thumbnails)
params = omero.sys.ParametersI()
params.addIds(list(thumbIds))
query = "select i.id from Image i where i.id in (:ids)"
rslt = conn.getQueryService().projection(query, params, conn.SERVICE_OPTS)
ids = [unwrap(r)[0] for r in rslt]
for fig in rsp:
if 'description' in fig:
desc = fig['description']
if 'imageId' in desc:
if desc['imageId'] not in ids and 'baseUrl' not in desc:
desc['imageId'] = -1
if len(thumbIds) > 0:
# remove image Ids if images deleted (to prevent 404 for thumbnails)
params = omero.sys.ParametersI()
params.addIds(list(thumbIds))
query = "select i.id from Image i where i.id in (:ids)"
qs = conn.getQueryService()
rslt = qs.projection(query, params, conn.SERVICE_OPTS)
ids = [unwrap(r)[0] for r in rslt]
for fig in rsp:
if 'description' in fig:
desc = fig['description']
if 'imageId' in desc:
if desc['imageId'] not in ids and 'baseUrl' not in desc:
desc['imageId'] = -1

return HttpResponse(json.dumps(rsp), content_type='json')

Expand Down

0 comments on commit befa276

Please sign in to comment.