예제 #1
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2020 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_livesync_cern.controllers import RHCategoriesJSON

blueprint = IndicoPluginBlueprint('livesync_cern', __name__)

blueprint.add_url_rule('/livesync/cernsearch/categories.json',
                       'categories_json', RHCategoriesJSON)
예제 #2
0
파일: plugin.py 프로젝트: meluru/clippy
 def get_blueprints(self):
     return IndicoPluginBlueprint(self.name, __name__)
예제 #3
0
 def get_blueprints(self):
     return IndicoPluginBlueprint('search_json', 'indico_search_json')
예제 #4
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_bbb.controllers import RHStartAndJoin, RHVCManageEventSlides, RHVCManageEventRecordings, RHVCViewEventRecordings

blueprint = IndicoPluginBlueprint('vc_bbb', 'indico_vc_bbb')

blueprint.add_url_rule(
    '/event/<int:event_id>/videoconference/<any(bbb):service>/<int:event_vc_room_id>/start',
    'start_and_join',
    RHStartAndJoin,
    methods=('POST', 'GET'))
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/slides',
    'slides',
    RHVCManageEventSlides,
    methods=('POST', 'GET'))
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/recordings',
    'recordings', RHVCManageEventRecordings)
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/view_recordings',
    'view_recordings', RHVCViewEventRecordings)
예제 #5
0
#
# You should have received a copy of the GNU General Public License
# along with SixPay Indico EPayment Plugin;
# if not, see <http://www.gnu.org/licenses/>.
"""Definition of callbacks exposed by the Indico server."""
from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from .request_handlers import (SixPayResponseHandler, UserCancelHandler,
                               UserFailureHandler, UserSuccessHandler)

#: url mount points exposing callbacks
blueprint = IndicoPluginBlueprint(
    'payment_sixpay',
    __name__,
    url_prefix=('/event/<confId>/registrations/'
                '<int:reg_form_id>/payment/response/sixpay'))

blueprint.add_url_rule('/failure',
                       'failure',
                       UserCancelHandler,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/cancel',
                       'cancel',
                       UserFailureHandler,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       UserSuccessHandler,
                       methods=('GET', 'POST'))
예제 #6
0
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_paypal.controllers import RHPaypalCancel, RHPaypalIPN, RHPaypalSuccess

blueprint = IndicoPluginBlueprint(
    'payment_paypal',
    __name__,
    url_prefix=
    '/event/<confId>/registrations/<int:reg_form_id>/payment/response/paypal')

blueprint.add_url_rule('/cancel',
                       'cancel',
                       RHPaypalCancel,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       RHPaypalSuccess,
                       methods=('GET', 'POST'))
# Used by PayPal to send an asynchronous notification for the transaction (pending, successful, etc)
blueprint.add_url_rule('/ipn', 'notify', RHPaypalIPN, methods=('POST', ))
예제 #7
0
                url_rule_to_js('contributions.create_contrib_reference_rest'),
                'create_subcontrib_reference_rest':
                url_rule_to_js('contributions'
                               '.create_subcontrib_reference_rest'),
                'add_link':
                url_rule_to_js('attachments.add_link')
            }
        }

    def register_assets(self):
        self.register_js_bundle('importer_js', 'js/importer.js')
        self.register_css_bundle('importer_css', 'css/importer.css')

    def register_importer_engine(self, importer_engine, plugin):
        self.importer_engines[importer_engine._id] = (importer_engine, plugin)


blueprint = IndicoPluginBlueprint('importer', __name__)
blueprint.add_url_rule('/importers/<importer_name>/search',
                       'import_data',
                       RHImportData,
                       methods=('POST', ))
blueprint.add_url_rule('/importers/', 'importers', RHGetImporters)

blueprint.add_url_rule(
    '/importers/<importer_name>/event/<confId>/day-end-date', 'day_end_date',
    RHDayEndTime)
blueprint.add_url_rule(
    '/importers/<importer_name>/event/<confId>/entry/<entry_id>/block-end-date',
    'block_end_date', RHBlockEndTime)
예제 #8
0
# This file is part of the Indico plugins.
# Copyright (C) 2020 - 2021 CERN and ENEA
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_zoom.controllers import RHRoomAlternativeHost, RHWebhook

blueprint = IndicoPluginBlueprint('vc_zoom', 'indico_vc_zoom')

# Room management
# using any(zoom) instead of defaults since the event vc room locator
# includes the service and normalization skips values provided in 'defaults'
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(zoom):service>/<int:event_vc_room_id>/make-me-alt-host',
    'make_me_alt_host',
    RHRoomAlternativeHost,
    methods=('POST', ))
blueprint.add_url_rule('/api/plugin/zoom/webhook',
                       'webhook',
                       RHWebhook,
                       methods=('POST', ))
예제 #9
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_vidyo.controllers import RHVidyoRoomOwner

blueprint = IndicoPluginBlueprint('vc_vidyo', 'indico_vc_vidyo')

# Room management
# using any(vidyo) instead of defaults since the event vc room locator
# includes the service and normalization skips values provided in 'defaults'
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(vidyo):service>/<int:event_vc_room_id>/room-owner',
    'set_room_owner',
    RHVidyoRoomOwner,
    methods=('POST', ))
# This file is part of Indico.
# Copyright (C) 2017 Bjoern Pedersen.
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_print_checkin.controllers import RHPrintBadgeManageEvent

blueprint = IndicoPluginBlueprint('print_checkin', 'print_checkin', url_prefix='/event/<confId>')


# Event management
blueprint.add_url_rule('/manage/printbadge/', 'configure', RHPrintBadgeManageEvent, methods=('GET', 'POST'))
예제 #11
0
 def get_blueprints(self):
     return IndicoPluginBlueprint('search_invenio', 'indico_search_invenio')
예제 #12
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_cern.controllers import (RHPaymentCancel, RHPaymentCancelBackground, RHPaymentDecline,
                                             RHPaymentSuccess, RHPaymentSuccessBackground, RHPaymentUncertain)


blueprint = IndicoPluginBlueprint(
    'payment_cern', __name__,
    url_prefix='/event/<int:event_id>/registrations/<int:reg_form_id>/payment/response/cern'
)
blueprint.add_url_rule('/cancel', 'cancel', RHPaymentCancel, methods=('GET', 'POST'))
blueprint.add_url_rule('/decline', 'decline', RHPaymentDecline, methods=('GET', 'POST'))
blueprint.add_url_rule('/uncertain', 'uncertain', RHPaymentUncertain, methods=('GET', 'POST'))
blueprint.add_url_rule('/success', 'success', RHPaymentSuccess, methods=('GET', 'POST'))
# ID-less URL for the callback where we cannot customize anything besides a single variable
blueprint.add_url_rule('!/payment/cern/success', 'background-success', RHPaymentSuccessBackground,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('!/payment/cern/cancel', 'background-cancel', RHPaymentCancelBackground,
                       methods=('GET', 'POST'))
예제 #13
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2020 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from flask import redirect
from werkzeug.exceptions import NotFound

from indico.core.plugins import IndicoPluginBlueprint
from indico.modules.rb.models.rooms import Room

blueprint = IndicoPluginBlueprint('foundationsync', __name__)


@blueprint.route('!/rooms/resolve/<building>/<floor>-<number>')
def resolve_room(building, floor, number):
    room = Room.query.filter(~Room.is_deleted, Room.building == building,
                             Room.floor == floor,
                             Room.number == number).one_or_none()
    if not room:
        raise NotFound
    return redirect(room.details_url)
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_ursh.controllers import RHCustomShortURLPage, RHGetShortURL, RHShortURLPage


blueprint = IndicoPluginBlueprint('ursh', 'indico_ursh')
blueprint.add_url_rule('/ursh', 'get_short_url', RHGetShortURL, methods=('POST',))
blueprint.add_url_rule('/url-shortener', 'shorten_url', RHShortURLPage)
blueprint.add_url_rule('/event/<confId>/manage/short-url', 'shorten_event_url', RHCustomShortURLPage,
                       methods=('GET', 'POST'))
예제 #15
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_search.controllers import RHSearch, RHSearchCategoryTitles

blueprint = IndicoPluginBlueprint('search', 'indico_search')

blueprint.add_url_rule('/search', 'search', RHSearch)
blueprint.add_url_rule('/category/<int:category_id>/search', 'search',
                       RHSearch)
blueprint.add_url_rule('/event/<confId>/search', 'search', RHSearch)

blueprint.add_url_rule('/category/search-titles', 'category_names',
                       RHSearchCategoryTitles)
예제 #16
0
                    event_id=params['event_id'], id=contrib_id)
                if contribution:
                    cid = (contribution.legacy_mapping.legacy_contribution_id
                           if contribution.legacy_mapping else contribution.id)
                    params['contrib_id'] = '{}t{}'.format(
                        contribution.event_id, cid)
        return params

    def _get_tracking_url(self):
        url = self.settings.get('server_url')
        url = url if url.endswith('/') else url + '/'
        url = urlparse.urlparse(url)
        return url.netloc + url.path


blueprint = IndicoPluginBlueprint(
    'piwik', __name__, url_prefix='/event/<confId>/manage/statistics')
blueprint.add_url_rule('/', 'view', RHStatistics)
blueprint.add_url_rule('/material',
                       'material',
                       RHApiMaterial,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/data/downloads',
                       'data_downloads',
                       RHApiDownloads,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/data/visits',
                       'data_visits',
                       RHApiEventVisitsPerDay,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/graph/countries',
                       'graph_countries',
예제 #17
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_audiovisual.controllers import RHRequestList

blueprint = IndicoPluginBlueprint('audiovisual',
                                  __name__,
                                  url_prefix='/service/audiovisual')
blueprint.add_url_rule('/', 'request_list', RHRequestList)
예제 #18
0
 def get_blueprints(self):
     return IndicoPluginBlueprint('vc_dummy', __name__)
예제 #19
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_storage_s3.controllers import RHBuckets

blueprint = IndicoPluginBlueprint('storage_s3',
                                  __name__,
                                  url_prefix='/api/plugin/s3')
blueprint.add_url_rule('/buckets', 'buckets', RHBuckets)
예제 #20
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2017 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_ravem.controllers import RHRavemConnectRoom, RHRavemDisconnectRoom, RHRavemRoomStatus

blueprint = IndicoPluginBlueprint(
    'ravem',
    'indico_ravem',
    url_prefix='/event/<confId>/videoconference/ravem')

blueprint.add_url_rule('/room-status/<int:event_vc_room_id>/', 'room_status',
                       RHRavemRoomStatus)
blueprint.add_url_rule('/connect-room/<int:event_vc_room_id>/',
                       'connect_room',
                       RHRavemConnectRoom,
                       methods=('POST', ))
blueprint.add_url_rule('/disconnect-room/<int:event_vc_room_id>/',
                       'disconnect_room',
                       RHRavemDisconnectRoom,
                       methods=('POST', ))
예제 #21
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2017 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_conversion.conversion import RHConversionCheck, RHConversionFinished


blueprint = IndicoPluginBlueprint('conversion', __name__)
blueprint.add_url_rule('/conversion/finished', 'callback', RHConversionFinished, methods=('POST',))
blueprint.add_url_rule('/conversion/check', 'check', RHConversionCheck)
예제 #22
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2018 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_assistance.controllers import RHRequestList

blueprint = IndicoPluginBlueprint('vc_assistance',
                                  __name__,
                                  url_prefix='/service/vc-assistance')
blueprint.add_url_rule('/', 'request_list', RHRequestList)
예제 #23
0
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_livesync.controllers import RHAddAgent, RHDeleteAgent, RHEditAgent

blueprint = IndicoPluginBlueprint('livesync',
                                  'indico_livesync',
                                  url_prefix='/admin/plugins/livesync')

blueprint.add_url_rule('/agents/create/<backend>',
                       'add_agent',
                       RHAddAgent,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>',
                       'edit_agent',
                       RHEditAgent,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>',
                       'delete_agent',
                       RHDeleteAgent,
                       methods=('DELETE', ))
# Copyright (c) 2018 Björn Pedersen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Created on Mar 9, 2018
#
# @author: pedersen


from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

blueprint = IndicoPluginBlueprint('split_rooms', __name__, url_prefix='/mlz/splitrooms')
# API
예제 #25
0
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from indico.core.plugins import IndicoPluginBlueprint

from indico_previewer_jupyter.controllers import RHEventPreviewIPyNB

blueprint = IndicoPluginBlueprint('previewer_jupyter', __name__)
blueprint.add_url_rule('/preview/ipynb/<int:attachment_id>', 'preview_ipynb',
                       RHEventPreviewIPyNB)
예제 #26
0
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from flask import redirect, request
from werkzeug.exceptions import NotFound

from indico.core.plugins import IndicoPluginBlueprint
from indico.modules.events.agreements.models.agreements import Agreement
from indico.web.flask.util import url_for

from indico_audiovisual.definition import AVRequest, SpeakerReleaseAgreement

compat_blueprint = IndicoPluginBlueprint('compat_audiovisual',
                                         'indico_audiovisual')


@compat_blueprint.route('/event/<int:event_id>/collaboration/agreement')
def redirect_old_agreement_url(event_id):
    uuid = request.args['authKey']
    agreement = Agreement.query.filter_by(event_id=event_id, uuid=uuid).first()
    if agreement is None:
        raise NotFound
    return redirect(
        url_for('agreements.agreement_form',
                event_id=event_id,
                id=agreement.id,
                uuid=uuid))

예제 #27
0
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_cern_access.controllers import (
    RHExportCERNAccessCSV, RHExportCERNAccessExcel,
    RHRegistrationAccessIdentityData, RHRegistrationEnterIdentityData,
    RHRegistrationGrantCERNAccess, RHRegistrationPreviewCERNAccessEmail,
    RHRegistrationRevokeCERNAccess)

blueprint = IndicoPluginBlueprint('cern_access',
                                  __name__,
                                  url_prefix='/event/<confId>')

blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/grant',
    'registrations_grant_cern_access',
    RHRegistrationGrantCERNAccess,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/revoke',
    'registrations_revoke_cern_access',
    RHRegistrationRevokeCERNAccess,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/email-preview',
    'registrations_preview_cern_access_email',
예제 #28
0
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_chat.controllers.event import RHChatEventPage
from indico_chat.controllers.logs import RHChatManageEventLogs, RHChatManageEventShowLogs, RHChatManageEventAttachLogs
from indico_chat.controllers.management import (
    RHChatManageEvent, RHChatManageEventModify, RHChatManageEventRefresh,
    RHChatManageEventRemove, RHChatManageEventCreate, RHChatManageEventAttach)

blueprint = IndicoPluginBlueprint('chat',
                                  'indico_chat',
                                  url_prefix='/event/<confId>')

# Event
blueprint.add_url_rule('/chat', 'event_page', RHChatEventPage)

# Event management
blueprint.add_url_rule('/manage/chat/', 'manage_rooms', RHChatManageEvent)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/',
                       'manage_rooms_modify',
                       RHChatManageEventModify,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/',
                       'manage_rooms_logs', RHChatManageEventLogs)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/show',
                       'manage_rooms_show_logs', RHChatManageEventShowLogs)
예제 #29
0
 def get_blueprints(self):
     return IndicoPluginBlueprint('payment_manual', __name__)
            break
    else:
        raise BadRequest(response=redirect(event.url))
    if vca.data.get('only_registered_users') and \
        not any([x[1] for x in get_event_regforms(event, session.user)]):
        flash(_("The vc link is only available to registered users."), 'error')
        raise BadRequest(response=redirect(event.url))

    vcroom = vca.vc_room
    url = vcroom.data['room_url_base']
    data = {'id': contrib.friendly_id, 'username': session.user.name}

    req = requests.post(url, json=data)
    if req.status_code != 200:
        flash('Error: The redirector did not succeed!', 'error')
        raise BadRequest(response=redirect(event.url))

    res = req.json()
    if res['status'] != 'success':
        flash(_("Videoconference link:") + ' ' + res['message'], 'error')
        raise BadRequest(response=redirect(event.url))

    return redirect(res['url'])


_bp = IndicoPluginBlueprint('vc_redirector', __name__)

_bp.add_url_rule('/redirectVC/<contrib_id>',
                 'vc_redirect',
                 view_func=RHredirectToExternal)