Merge pull request #125 from valueonag/feat/demo-system-readieness

fixes comcoach
This commit is contained in:
Patrick Motsch 2026-04-16 14:21:58 +02:00 committed by GitHub
commit 8634f3cd63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -150,7 +150,7 @@ async def checkAndAwardBadges(interface, userId: str, mandateId: str, instanceId
except Exception: except Exception:
allContexts = [] allContexts = []
completedTasks = interface.getCompletedTaskCount(userId) if hasattr(interface, 'getCompletedTaskCount') else 0 completedTasks = interface.getCompletedTaskCount(userId, instanceId) if hasattr(interface, 'getCompletedTaskCount') else 0
if completedTasks >= 10: if completedTasks >= 10:
badgesToCheck.append(("task_completer", True)) badgesToCheck.append(("task_completer", True))

View file

@ -1563,7 +1563,13 @@ async def sync_positions_to_accounting(
raise HTTPException(status_code=400, detail=routeApiMsg("positionIds required")) raise HTTPException(status_code=400, detail=routeApiMsg("positionIds required"))
results = await bridge.pushBatchToAccounting(instanceId, positionIds) results = await bridge.pushBatchToAccounting(instanceId, positionIds)
failed = [r for r in results if not r.success] skipped = [r for r in results if not r.success and r.errorMessage and "already synced" in r.errorMessage]
failed = [r for r in results if not r.success and r not in skipped]
if skipped:
logger.info(
"Accounting sync: %s position(s) already synced, skipped",
len(skipped),
)
if failed: if failed:
logger.warning( logger.warning(
"Accounting sync had %s failure(s): %s", "Accounting sync had %s failure(s): %s",
@ -1573,7 +1579,8 @@ async def sync_positions_to_accounting(
return { return {
"total": len(results), "total": len(results),
"success": sum(1 for r in results if r.success), "success": sum(1 for r in results if r.success),
"errors": sum(1 for r in results if not r.success), "skipped": len(skipped),
"errors": len(failed),
"results": [r.model_dump() for r in results], "results": [r.model_dump() for r in results],
} }