def _add_codes_if_missing(client_id): """Don't add missing codes for questionnaire responses submitted by the config admin (our command line tools.) Tests override this to return true. """ return not is_config_admin(client_id)
def wrapped(*args, **kwargs): if not is_config_admin(api_util.get_oauth_id()): _, user_info = get_validated_user_info() if not HEALTHPRO in user_info.get('roles', []): logging.info( 'User has roles {}, but HEALTHPRO or admin is required'. format(user_info.get('roles'))) raise Forbidden() return func(*args, **kwargs)