Add messaging around required params for oauth. Style fixes.
This commit is contained in:
parent
70a35ab421
commit
b39b847c98
2 changed files with 25 additions and 5 deletions
|
@ -67,6 +67,17 @@ def truthy_param(param):
|
|||
return param not in {False, 'false', 'False', '0', 'FALSE', '', 'null'}
|
||||
|
||||
|
||||
def param_required(param_name):
|
||||
def wrapper(wrapped):
|
||||
@wraps(wrapped)
|
||||
def decorated(*args, **kwargs):
|
||||
if param_name not in request.args:
|
||||
abort(make_response('Required param: %s' % param_name, 400))
|
||||
return wrapped(*args, **kwargs)
|
||||
return decorated
|
||||
return wrapper
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(username):
|
||||
logger.debug('User loader loading deferred user: %s' % username)
|
||||
|
@ -198,7 +209,7 @@ def start_build(repository, dockerfile_id, tags, build_name, subdir, manual,
|
|||
|
||||
build_request = model.create_repository_build(repository, token, job_config,
|
||||
dockerfile_id, build_name,
|
||||
trigger, pull_robot_name = pull_robot_name)
|
||||
trigger, pull_robot_name=pull_robot_name)
|
||||
|
||||
dockerfile_build_queue.put([repository.namespace, repository.name], json.dumps({
|
||||
'build_uuid': build_request.uuid,
|
||||
|
|
Reference in a new issue