From f39182dc779a942d87283b08b24463bc6d00aad3 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Mon, 5 Feb 2024 09:46:31 +0000
Subject: [PATCH] Use AW status on myMdC for warnings on correction

---
 webservice/webservice.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/webservice/webservice.py b/webservice/webservice.py
index 2ce0f9d3e..5e49f8f53 100644
--- a/webservice/webservice.py
+++ b/webservice/webservice.py
@@ -770,9 +770,11 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
     Further informations are available at:
     https://git.xfel.eu/gitlab/detectors/pycalibration/wikis/MyMDC-Communication
     """
-    if message.split(':')[0] in ('FAILED', 'WARN'):  # Errors
+    if message.startswith('FAILED:'):
         flag = 'E'
-    elif message.split(':')[0] == 'SUCCESS':  # Success
+    elif message.startswith('WARN:'):
+        flag = 'AW' if action == 'correct' else 'E'
+    elif message.startswith('SUCCESS:'):
         flag = 'IP'
         if 'Uploaded' in message or 'Finished' in message:
             flag = 'A' if action == 'correct' else 'F'
-- 
GitLab