From b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 10 Jan 2022 13:58:16 +0100 Subject: [PATCH] VC/Zoom: Add skip_access_check param --- vc_zoom/README.md | 4 ++++ vc_zoom/indico_vc_zoom/plugin.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vc_zoom/README.md b/vc_zoom/README.md index e3f6782..4ce54f5 100644 --- a/vc_zoom/README.md +++ b/vc_zoom/README.md @@ -11,6 +11,10 @@ ## Changelog +### 3.1 + +- Adapt to Indico 3.1 changes (include Zoom link in event reminder emails regardless of visibility) + ### 3.0.2 - Fix JavaScript being included twice on conference VC page diff --git a/vc_zoom/indico_vc_zoom/plugin.py b/vc_zoom/indico_vc_zoom/plugin.py index 2d30e7b..821e02b 100644 --- a/vc_zoom/indico_vc_zoom/plugin.py +++ b/vc_zoom/indico_vc_zoom/plugin.py @@ -544,7 +544,7 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin): flash(message, 'warning') - def _event_metadata_postprocess(self, sender, event, data, user=None, **kwargs): + def _event_metadata_postprocess(self, sender, event, data, user=None, skip_access_check=False, **kwargs): urls = [] if 'description' in kwargs.get('html_fields', ()): linebreak = '
\n' @@ -558,6 +558,7 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin): continue visibility = assoc.data.get('password_visibility', 'logged_in') if ( + (skip_access_check and visibility != 'no_one') or visibility == 'everyone' or (visibility == 'logged_in' and user is not None) or (visibility == 'registered' and user is not None and event.is_user_registered(user)) or @@ -566,7 +567,7 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin): urls.append(format_link(assoc.vc_room.name, assoc.vc_room.data['url'])) elif visibility == 'no_one': # XXX: Not sure if showing this is useful, but on the event page we show the join link - # with no passcode as well, so let's the logic identical here. + # with no passcode as well, so let's keep the logic identical here. urls.append(format_link(assoc.vc_room.name, assoc.vc_room.data['public_url'])) if urls: