diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b304839..40133470 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev + sudo apt-get install libsasl2-dev python3-dev libldap2-dev libssl-dev - name: Setup Python uses: actions/setup-python@v2 with: diff --git a/flask_app/blueprints/api/blueprint.py b/flask_app/blueprints/api/blueprint.py index 9493ed78..4d317a58 100644 --- a/flask_app/blueprints/api/blueprint.py +++ b/flask_app/blueprints/api/blueprint.py @@ -4,8 +4,7 @@ from flask_simple_api import SimpleAPI from ... import activity -from ...utils.api_utils import (auto_render, requires_login, - requires_login_or_runtoken) +from ...utils.api_utils import auto_render, requires_login, requires_login_or_runtoken blueprint = Blueprint('api', __name__, url_prefix='/api') @@ -14,7 +13,7 @@ _api_info = {'endpoints': {}} -def API(func=None, require_real_login=False, generates_activity=True, require_login=True, version=1): +def API(func=None, require_real_login=False, generates_activity=False, require_login=True, version=1): if func is None: return functools.partial(API, require_real_login=require_real_login, generates_activity=generates_activity, require_login=require_login, version=version) diff --git a/flask_app/blueprints/api/sessions.py b/flask_app/blueprints/api/sessions.py index c6dbcb74..c9745b4f 100644 --- a/flask_app/blueprints/api/sessions.py +++ b/flask_app/blueprints/api/sessions.py @@ -2,18 +2,16 @@ from flask_simple_api import error_abort import flux import requests - -from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.exc import IntegrityError -from ...auth import get_or_create_user +from sqlalchemy.orm.exc import NoResultFound +from ...auth import get_or_create_user +from ...models import Session, SessionMetadata, Test, User, db from ...search import get_orm_query_from_search_string -from ...models import Session, Test, db, SessionMetadata, User -from ...utils import get_current_time, statuses +from ...utils import get_current_time, profiling, statuses from ...utils.api_utils import requires_role from ...utils.subjects import get_or_create_subject_instance from ...utils.users import has_role -from ...utils import profiling from .blueprint import API NoneType = type(None) @@ -21,7 +19,7 @@ _DEFAULT_DELETE_GRACE_PERIOD_SECONDS = 60 * 60 * 24 * 30 -@API(version=3) +@API(version=3, generates_activity=True) def report_session_start(logical_id: str=None, parent_logical_id: (NoneType, str)=None, is_parent_session: bool=False, @@ -109,7 +107,7 @@ def report_session_start(logical_id: str=None, return returned -@API(version=2) +@API(version=2, generates_activity=True) def report_session_end(id: int, duration: (int, NoneType)=None, has_fatal_errors: bool=False): try: session = Session.query.filter(Session.id == id).one()