diff --git a/app/server.py b/app/server.py index 1ee67c8f..366978d9 100644 --- a/app/server.py +++ b/app/server.py @@ -489,8 +489,8 @@ def check_list_data(): def get_query(req): - # query for download csv/zip - filter_query = checklist_filter(req.args) + # query for download csv/zip (only for admins) + filter_query = checklist_filter(req.args, is_admin=True) limit = False offset = False sort = req.args.get("sort", "") diff --git a/app/utils/checklist_filter.py b/app/utils/checklist_filter.py index 795c9d2a..9e809dde 100644 --- a/app/utils/checklist_filter.py +++ b/app/utils/checklist_filter.py @@ -8,7 +8,7 @@ logger = logging.getLogger('root_logger') FILTER_PREFIX = 'filter_' -def checklist_filter(data): +def checklist_filter(data, is_admin=False): from utils import timezone_offset filters = {key[len(FILTER_PREFIX):]: data[key] for key in data if key.startswith(FILTER_PREFIX)} @@ -80,7 +80,7 @@ def checklist_filter(data): logger.warning(repr(e)) # set user filter for current non-admin user - if not current_user.is_admin: + if not (is_admin or current_user.is_admin): filter_query["user"] = current_user.username return filter_query