Merge pull request #39 from JustinZeus/mypi-fix

" "
This commit is contained in:
JustinZeus 2026-03-01 23:12:26 +01:00 committed by GitHub
commit 76469e2d1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -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",

View file

@ -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