]> git.parisson.com Git - teleforma.git/commitdiff
Improve script when no meetings are available https://trackers.pilotsystems.net/proba...
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 2 Dec 2020 11:54:50 +0000 (12:54 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 2 Dec 2020 11:54:50 +0000 (12:54 +0100)
teleforma/management/commands/teleforma-revisions-from-bbb.py

index c9f68fcd15651499fe2413132e55acdca65203c3..46fcc5b9fbeba47562462e8fe43fcf52fffa1a3f 100644 (file)
@@ -24,12 +24,18 @@ class Command(BaseCommand):
             print("Syntax: %s %s <duration in seconds>" % (sys.argv[0],
                                                            sys.argv[1]))
             sys.exit(1)
-        duration = int(args[0])
-        meetings = bbb.get_meetings()
-        meetings = as_list(meetings.get_field("meetings")["meeting"])
 
+        duration = int(args[0])
         end = datetime.datetime.now()
         start = end - datetime.timedelta(seconds = duration)
+        print("=== Starting at %s" % end.strftime('%Y-%m-%d %H:%M:%S'))
+        meetings = bbb.get_meetings()
+        meetings = meetings.get_field("meetings")
+        # no conference in BBB
+        if "meeting" not in meetings:
+            print("No meeting found")
+            return
+        meetings = as_list(meetings["meeting"])
 
         print("=== Starting at %s" % end.strftime('%Y-%m-%d %H:%M:%S'))