Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switched dangerous default arguments to None #635

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion hasjob/views/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,14 +919,16 @@ 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.
- The keys accepted in the `filters` object are: `locations`, `anywhere`, `categories`, `types,
`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:
Expand Down
4 changes: 3 additions & 1 deletion hasjob/views/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,9 @@ def pinnedjob(domain, hashid):
@app.route('/reject/<hashid>', 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 = {
Expand Down