From 85ccf90e33ed8b60f3dc4b45fb7a5435cf7702b8 Mon Sep 17 00:00:00 2001 From: Loan Robert Date: Fri, 7 Jun 2024 18:49:52 +0200 Subject: [PATCH] Fix double uploads for non default files if room is too slow to create --- web/b3desk/models/bbb.py | 10 ++++++++-- web/b3desk/models/meetings.py | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/web/b3desk/models/bbb.py b/web/b3desk/models/bbb.py index 4b7c95f..d8be873 100644 --- a/web/b3desk/models/bbb.py +++ b/web/b3desk/models/bbb.py @@ -198,7 +198,11 @@ def create(self): data = self.bbb_response(request) # non default files are sent later - if self.meeting.non_default_files: + if ( + self.meeting.non_default_files + and "returncode" in data + and data["returncode"] == "SUCCESS" + ): xml = self.meeting_file_addition_xml(self.meeting.non_default_files) request = self.bbb_request( "insertDocument", params={"meetingID": self.meeting.meetingID} @@ -320,7 +324,9 @@ def meeting_file_addition_xml(self, meeting_files): f"{current_app.config['SECRET_KEY']}-0-{meeting_file.id}-{current_app.config['SECRET_KEY']}".encode() ).hexdigest() current_app.logger.info( - "Add document on BigBLueButton room creation for file %s", + "Add document on BigBLueButton room %s %s creation for file %s", + self.meeting.name, + self.meeting.id, meeting_file.title, ) url = url_for( diff --git a/web/b3desk/models/meetings.py b/web/b3desk/models/meetings.py index e4ae621..a965379 100644 --- a/web/b3desk/models/meetings.py +++ b/web/b3desk/models/meetings.py @@ -204,6 +204,9 @@ def get_join_url( not is_meeting_available and (meeting_role == Role.moderator) and create ) if should_create_room: + current_app.logger.info( + "Request BBB room creation %s %s", self.name, self.id + ) data = self.create_bbb() if "returncode" in data and data["returncode"] == "SUCCESS": is_meeting_available = True