From 83e04074910891c818f3a9a75e462f17f5c75089 Mon Sep 17 00:00:00 2001 From: Justin Visser Date: Sun, 1 Mar 2026 23:11:52 +0100 Subject: [PATCH] " " --- app/services/scholars/application.py | 8 +++++++- tests/integration/test_run_lifecycle_consistency.py | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/services/scholars/application.py b/app/services/scholars/application.py index 894c371..028e3fc 100644 --- a/app/services/scholars/application.py +++ b/app/services/scholars/application.py @@ -10,7 +10,11 @@ from app.db.models import ScholarProfile from app.services.scholar.parser import ScholarParserError, parse_profile_page from app.services.scholar.source import ScholarSource from app.services.scholars.author_search import search_author_candidates -from app.services.scholars.constants import ALLOWED_IMAGE_UPLOAD_CONTENT_TYPES +from app.services.scholars.constants import ( + ALLOWED_IMAGE_UPLOAD_CONTENT_TYPES, + SEARCH_COOLDOWN_REASON, + SEARCH_DISABLED_REASON, +) from app.services.scholars.exceptions import ScholarServiceError from app.services.scholars.uploads import ( _ensure_upload_root, @@ -24,6 +28,8 @@ from app.services.scholars.validators import ( ) __all__ = [ + "SEARCH_COOLDOWN_REASON", + "SEARCH_DISABLED_REASON", "ScholarServiceError", "clear_profile_image_customization", "create_scholar_for_user", diff --git a/tests/integration/test_run_lifecycle_consistency.py b/tests/integration/test_run_lifecycle_consistency.py index df6142b..2f96247 100644 --- a/tests/integration/test_run_lifecycle_consistency.py +++ b/tests/integration/test_run_lifecycle_consistency.py @@ -346,6 +346,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent( ) db_session.add_all([run, publication]) await db_session.commit() + run_id = int(run.id) call_count = 0 @@ -397,7 +398,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent( publications=publications, ) - refreshed_run = await db_session.get(CrawlRun, int(run.id)) + refreshed_run = await db_session.get(CrawlRun, run_id) assert refreshed_run is not None assert int(refreshed_run.new_pub_count) == 1 link_count_result = await db_session.execute( @@ -409,7 +410,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent( AND first_seen_run_id = :run_id """ ), - {"scholar_profile_id": scholar_profile_id, "run_id": int(run.id)}, + {"scholar_profile_id": scholar_profile_id, "run_id": run_id}, ) assert int(link_count_result.scalar_one()) == 1 -- 2.49.1