Browse Source

Multiple TestStepMaster Bug resolved

Akash Singh 3 years ago
parent
commit
98da90a373
1 changed files with 6 additions and 1 deletions
  1. 6 1
      StatisticServer/models.py

+ 6 - 1
StatisticServer/models.py

@@ -1,6 +1,7 @@
 from StatisticServer import db
 from datetime import datetime
 import uuid
+import json
 
 
 def uuidAsBytes():
@@ -51,7 +52,11 @@ class TestRunStatistics(db.Model):
             elif key == "sendingTime":
                 new_dic["sendingTime"] = dic[key].strftime('%d-%m-%Y %H:%M:%S')
             elif key == "TestStepMaster":
-                new_dic["TestStepMaster"] = ", ".join([f"{ky}: {dic[key][ky]}" for ky in dic[key]]),
+                try:
+                    TestStepMaster = json.loads(dic[key])
+                    new_dic["TestStepMaster"] = ", ".join([f"{ky}: {TestStepMaster[ky]}" for ky in TestStepMaster])
+                except:
+                    new_dic["TestStepMaster"] = ''
             else:
                 new_dic[key] = dic[key]
         return new_dic