VC/Zoom: Refresh data before editing

This commit is contained in:
Adrian Moennich 2021-02-09 16:22:20 +01:00
parent 438ddd4c96
commit d7719612e3
2 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,7 @@
- Fix deleting Zoom meetings that were already deleted on the Zoom side when running outside a web request context (e.g. during scheduled deletion of events)
- Fix overwriting co-hosts added via the Zoom client when using "make me co-host" in Indico
- Always refresh data from Zoom before editing via Indico to avoid saving with stale data
### 2.3b2

View File

@ -7,7 +7,7 @@
from __future__ import unicode_literals
from flask import flash, has_request_context, session
from flask import flash, has_request_context, request, session
from markupsafe import escape
from requests.exceptions import HTTPError
from sqlalchemy.orm.attributes import flag_modified
@ -168,6 +168,17 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin):
def create_form(self, event, existing_vc_room=None, existing_event_vc_room=None):
"""Override the default room form creation mechanism."""
if existing_vc_room and request.method != 'POST':
try:
self.refresh_room(existing_vc_room, event)
except VCRoomNotFoundError as exc:
raise UserValueError(unicode(exc))
except VCRoomError:
# maybe a temporary issue - we just keep going and fail when saving in
# case it's something more persistent
pass
form = super(ZoomPlugin, self).create_form(
event,
existing_vc_room=existing_vc_room,