Skip to content

Commit

Permalink
add project null check
Browse files Browse the repository at this point in the history
  • Loading branch information
n00rsy committed Oct 30, 2024
1 parent 37ab1e1 commit b4c5f3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pybossa/api/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def _preprocess_post_data(self, data):
if 'n_answers' not in data:
project = project_repo.get(project_id)
data['n_answers'] = project.get_default_n_answers()
if not project:
raise BadRequest(f'Non existing project id {project_id}')
user_pref = data.get('user_pref', {})
if user_pref.get('languages'):
user_pref['languages'] = [s.lower() for s in user_pref.get('languages', [])]
Expand Down

0 comments on commit b4c5f3e

Please sign in to comment.