ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
21 stars 32 forks source link

getGridSize() handles plates with no Wells #398

Closed will-moore closed 5 months ago

will-moore commented 7 months ago

Fixes error from QA: https://www.openmicroscopy.org/qa2/qa/feedback/41352/

{"message": "'NoneType' object has no attribute 'val'", "stacktrace": "Traceback (most recent call last):
File \"/opt/omero/web/venv3/lib64/python3.9/site-packages/omeroweb/webgateway/views.py\", line 1500, in wrap
 rv = f(request, *args, **kwargs)
 File \"/opt/omero/web/venv3/lib64/python3.9/site-packages/omeroweb/webgateway/views.py\", line 1708, in plateGrid_json
 rv = plateGrid.metadata
 File \"/opt/omero/web/venv3/lib64/python3.9/site-packages/omeroweb/webgateway/plategrid.py\", line 71, in metadata
self.plate.setGridSizeConstraints(8, 12)
 File \"/opt/omero/web/venv3/lib64/python3.9/site-packages/omero/gateway/__init__.py\", line 6637, in setGridSizeConstraints
 gs = self.getGridSize()\n File \"/opt/omero/web/venv3/lib64/python3.9/site-packages/omero/gateway/__init__.py\", line 6659, in getGridSize
 self._gridSize = {'rows': row.val+1, 'columns': col.val+1}
AttributeError: 'NoneType' object has no attribute 'val'
"}

To test, create a Plate with no Wells:

$ omero obj new Plate name=empty

Browse in webclient:

Screenshot 2024-02-14 at 15 56 17