diff --git a/vc_zoom/README.md b/vc_zoom/README.md index d9b24e8..de652aa 100644 --- a/vc_zoom/README.md +++ b/vc_zoom/README.md @@ -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 diff --git a/vc_zoom/indico_vc_zoom/plugin.py b/vc_zoom/indico_vc_zoom/plugin.py index d3ece5f..b59cf4d 100644 --- a/vc_zoom/indico_vc_zoom/plugin.py +++ b/vc_zoom/indico_vc_zoom/plugin.py @@ -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,