Skip to content

Commit

Permalink
CU-8692nnx2z: only resubmit docs for projects in the 'annotating state'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomolopolis committed Sep 28, 2023
1 parent 137471a commit 9f771c1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions webapp/api/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ def ready(self):
'Attempting to resubmit all currently submitted state documents')
projects = ProjectAnnotateEntities.objects.all()
for project in projects:
validated_docs = project.validated_documents.all()
if len(validated_docs):
for doc in validated_docs:
try:
_submit_document(project, doc)
logger.info("Submitted doc: %s", doc.name)
except Exception as e:
logger.error("Failed to re-submit doc on startup with exception %s", e)
logger.info("Finished resubmitting Project %s", project.name)
if project.project_status == 'A':
logger.info('Found project %s - in annotating state - resubmitting all validated documents...',
project.name)
validated_docs = project.validated_documents.all()
if len(validated_docs):
for doc in validated_docs:
try:
_submit_document(project, doc)
logger.info("Submitted doc: %s", doc.name)
except Exception as e:
logger.error("Failed to re-submit doc on startup with exception %s", e)
logger.info("Finished resubmitting Project %s", project.name)
logger.info("MedCATTrainer App API ready...")

0 comments on commit 9f771c1

Please sign in to comment.