diff --git a/hasjob/views/helper.py b/hasjob/views/helper.py index aea31243..9771da75 100644 --- a/hasjob/views/helper.py +++ b/hasjob/views/helper.py @@ -919,7 +919,7 @@ def usessl(url): return url -def filter_basequery(basequery, filters, exclude_list=()): +def filter_basequery(basequery, filters, exclude_list=None): """ - Accepts a query of type sqlalchemy.Query, and returns a modified query based on the keys in the `filters` object. @@ -927,6 +927,8 @@ def filter_basequery(basequery, filters, exclude_list=()): `pay_min`, `pay_max`, `currency`, `equity` and `query`. - exclude_list is an array of keys that need to be ignored in the `filters` object """ + if exclude_list is None: + exclude_list = [] filter_by_location = filters.get('locations') and 'locations' not in exclude_list filter_by_anywhere = filters.get('anywhere') and 'anywhere' not in exclude_list if filter_by_location: diff --git a/hasjob/views/listing.py b/hasjob/views/listing.py index 184adae3..319ef682 100644 --- a/hasjob/views/listing.py +++ b/hasjob/views/listing.py @@ -806,7 +806,9 @@ def pinnedjob(domain, hashid): @app.route('/reject/', defaults={'domain': None}, methods=('GET', 'POST')) @lastuser.requires_permission('siteadmin') def rejectjob(domain, hashid): - def send_reject_mail(reject_type, post, banned_posts=()): + def send_reject_mail(reject_type, post, banned_posts=None): + if banned_posts is None: + banned_posts = [] if reject_type not in ['reject', 'ban']: return mail_meta = {