From 31ff85403121946de34bdbc0e86834659b74e143 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Thu, 30 Jan 2014 19:36:21 -0500 Subject: [PATCH] Fix the permissions for the build status tests. Fix a problem with logging the csrf token information when the user is anonymous. --- endpoints/api.py | 4 +--- test/specs.py | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/endpoints/api.py b/endpoints/api.py index 5548f62b9..2b31e4700 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -50,9 +50,7 @@ def csrf_protect(): logger.error(msg, token, found_token) if not token: - req_user = current_user.db_user().username if current_user else None - logger.warning('No CSRF token in session for current user: %s' % - req_user) + logger.warning('No CSRF token in session.') def request_error(exception=None, **kwargs): diff --git a/test/specs.py b/test/specs.py index 9ffcdc009..e0a037655 100644 --- a/test/specs.py +++ b/test/specs.py @@ -202,9 +202,11 @@ def build_specs(): 403, 403, 200, 200), TestSpec(url_for('api.get_repo_builds', repository=PUBLIC_REPO), - admin_code=403), - TestSpec(url_for('api.get_repo_builds', repository=ORG_REPO)), - TestSpec(url_for('api.get_repo_builds', repository=PRIVATE_REPO)), + 200, 200, 200, 200), + TestSpec(url_for('api.get_repo_builds', repository=ORG_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, 200).set_method('POST').set_data_from_obj(FILE_DROP_DETAILS),