Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions api/handlers/reporthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get(self, report_type):
try:
for doc in report.build():
writer.writerow(doc)

except APIReportException as e:
self.abort(404, str(e))
# Need to close and reopen file to flush buffer into file
Expand Down Expand Up @@ -491,7 +491,7 @@ def __init__(self, params):
:uid: user id of the target user
:limit: number of records to return
:subject: subject code of session accessed
:access_types: list of access_types to filter logs
:access_type: list of access_types to filter logs
:csv: Boolean if user wants csv file
"""

Expand All @@ -502,10 +502,7 @@ def __init__(self, params):
uid = params.get('user')
limit= params.get('limit', 100)
subject = params.get('subject', None)
if params.get('bin') == 'true':
access_types = params.get('access_types', [])
else:
access_types = params.getall('access_types')
access_types = params.getall('access_type')
csv_bool = (params.get('csv') == 'true')

if start_date:
Expand Down Expand Up @@ -548,7 +545,7 @@ def flatten(self, json_obj, flat, prefix = ""):
"""
flattens a document to not have nested objects
"""

for field in json_obj.keys():
if isinstance(json_obj[field], dict):
flat = self.flatten(json_obj[field], flat, prefix = prefix + field + ".")
Expand Down
2 changes: 1 addition & 1 deletion test/integration_tests/python/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_access_log_report(data_builder, with_user, as_user, as_admin):
data_builder.delete_project(project, recursive=True)

# get access log report of certain access types
r = as_admin.get('/report/accesslog', params={'access_types': ['user_login', 'view_container']})
r = as_admin.get('/report/accesslog', params={'access_type': ['user_login', 'view_container']})
assert r.ok
ul, vc = False, False

Expand Down