Merge pull request #125 from valueonag/feat/demo-system-readieness
fixes comcoach
This commit is contained in:
commit
8634f3cd63
2 changed files with 10 additions and 3 deletions
|
|
@ -150,7 +150,7 @@ async def checkAndAwardBadges(interface, userId: str, mandateId: str, instanceId
|
|||
except Exception:
|
||||
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:
|
||||
badgesToCheck.append(("task_completer", True))
|
||||
|
||||
|
|
|
|||
|
|
@ -1563,7 +1563,13 @@ async def sync_positions_to_accounting(
|
|||
raise HTTPException(status_code=400, detail=routeApiMsg("positionIds required"))
|
||||
|
||||
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:
|
||||
logger.warning(
|
||||
"Accounting sync had %s failure(s): %s",
|
||||
|
|
@ -1573,7 +1579,8 @@ async def sync_positions_to_accounting(
|
|||
return {
|
||||
"total": len(results),
|
||||
"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],
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue