Skip to content

Usage Report 500s when no data in system #915

@nagem

Description

@nagem

If you call /api/report/usage?type=project with zero acquisitions in the system it throws a 500

uwsgi_1           |   File "/usr/local/lib/python2.7/dist-packages/webapp2.py", line 570, in dispatch
uwsgi_1           |     return method(*args, **kwargs)
uwsgi_1           |   File "./api/handlers/reporthandler.py", line 95, in get
uwsgi_1           |     return report.build()
uwsgi_1           |   File "./api/handlers/reporthandler.py", line 648, in build
uwsgi_1           |     return self._build_project_report(query)
uwsgi_1           |   File "./api/handlers/reporthandler.py", line 881, in _build_project_report
uwsgi_1           |     analysis_ids.extend([an['_id'] for an in a.get('analyses', []) for a in acquisitions])
uwsgi_1           | UnboundLocalError: local variable 'a' referenced before assignment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions