Fix the permissions for the build status tests. Fix a problem with logging the csrf token information when the user is anonymous.
This commit is contained in:
parent
f840592b6e
commit
31ff854031
2 changed files with 6 additions and 6 deletions
|
@ -50,9 +50,7 @@ def csrf_protect():
|
||||||
logger.error(msg, token, found_token)
|
logger.error(msg, token, found_token)
|
||||||
|
|
||||||
if not token:
|
if not token:
|
||||||
req_user = current_user.db_user().username if current_user else None
|
logger.warning('No CSRF token in session.')
|
||||||
logger.warning('No CSRF token in session for current user: %s' %
|
|
||||||
req_user)
|
|
||||||
|
|
||||||
|
|
||||||
def request_error(exception=None, **kwargs):
|
def request_error(exception=None, **kwargs):
|
||||||
|
|
|
@ -202,9 +202,11 @@ def build_specs():
|
||||||
403, 403, 200, 200),
|
403, 403, 200, 200),
|
||||||
|
|
||||||
TestSpec(url_for('api.get_repo_builds', repository=PUBLIC_REPO),
|
TestSpec(url_for('api.get_repo_builds', repository=PUBLIC_REPO),
|
||||||
admin_code=403),
|
200, 200, 200, 200),
|
||||||
TestSpec(url_for('api.get_repo_builds', repository=ORG_REPO)),
|
TestSpec(url_for('api.get_repo_builds', repository=ORG_REPO),
|
||||||
TestSpec(url_for('api.get_repo_builds', repository=PRIVATE_REPO)),
|
403, 403, 200, 200),
|
||||||
|
TestSpec(url_for('api.get_repo_builds', repository=PRIVATE_REPO),
|
||||||
|
403, 403, 200, 200),
|
||||||
|
|
||||||
TestSpec(url_for('api.get_filedrop_url'), 401, 200, 200,
|
TestSpec(url_for('api.get_filedrop_url'), 401, 200, 200,
|
||||||
200).set_method('POST').set_data_from_obj(FILE_DROP_DETAILS),
|
200).set_method('POST').set_data_from_obj(FILE_DROP_DETAILS),
|
||||||
|
|
Reference in a new issue