Exemplo n.º 1
0
 def _process(self):
     form = CephalopodForm(obj=FormDefaults(**cephalopod_settings.get_all()))
     if form.validate_on_submit():
         return self._process_form(form)
     hub_url = url_join(config.COMMUNITY_HUB_URL, 'api/instance/{}'.format(cephalopod_settings.get('uuid')))
     cephalopod_settings.set('show_migration_message', False)
     return WPCephalopod.render_template('cephalopod.html', 'cephalopod',
                                         affiliation=core_settings.get('site_organization'),
                                         enabled=cephalopod_settings.get('joined'),
                                         form=form,
                                         indico_version=indico.__version__,
                                         instance_url=config.BASE_URL,
                                         language=config.DEFAULT_LOCALE,
                                         operating_system=get_os(),
                                         postgres_version=get_postgres_version(),
                                         python_version=platform.python_version(),
                                         hub_url=hub_url)
Exemplo n.º 2
0
 def _process(self):
     form = CephalopodForm(obj=FormDefaults(**cephalopod_settings.get_all()))
     if form.validate_on_submit():
         return self._process_form(form)
     hub_url = url_join(config.COMMUNITY_HUB_URL, 'api/instance/{}'.format(cephalopod_settings.get('uuid')))
     cephalopod_settings.set('show_migration_message', False)
     return WPCephalopod.render_template('cephalopod.html', 'cephalopod',
                                         affiliation=core_settings.get('site_organization'),
                                         enabled=cephalopod_settings.get('joined'),
                                         form=form,
                                         indico_version=indico.__version__,
                                         instance_url=config.BASE_URL,
                                         language=config.DEFAULT_LOCALE,
                                         operating_system=get_os(),
                                         postgres_version=get_postgres_version(),
                                         python_version=platform.python_version(),
                                         hub_url=hub_url,
                                         show_local_warning=(config.DEBUG or is_private_url(request.url_root)))
Exemplo n.º 3
0
    def _process_GET(self):
        defaults = FormDefaults(**cephalopod_settings.get_all())
        form = CephalopodForm(request.form, obj=defaults)

        enabled = cephalopod_settings.get('joined')
        config = Config.getInstance()
        instance_url = config.getBaseURL()
        language = config.getDefaultLocale()
        tracker_url = urljoin(
            config.getTrackerURL(),
            'api/instance/{}'.format(cephalopod_settings.get('uuid')))
        return WPCephalopod.render_template(
            'cephalopod.html',
            affiliation=core_settings.get('site_organization'),
            enabled=enabled,
            form=form,
            indico_version=indico.__version__,
            instance_url=instance_url,
            language=language,
            operating_system=get_os(),
            postgres_version=get_postgres_version(),
            python_version=platform.python_version(),
            tracker_url=tracker_url)
Exemplo n.º 4
0
 def _process(self):
     form = CephalopodForm(obj=FormDefaults(
         **cephalopod_settings.get_all()))
     if form.validate_on_submit():
         return self._process_form(form)
     config = Config.getInstance()
     hub_url = url_join(
         config.getCommunityHubURL(),
         'api/instance/{}'.format(cephalopod_settings.get('uuid')))
     cephalopod_settings.set('show_migration_message', False)
     return WPCephalopod.render_template(
         'cephalopod.html',
         'cephalopod',
         affiliation=core_settings.get('site_organization'),
         enabled=cephalopod_settings.get('joined'),
         form=form,
         indico_version=indico.__version__,
         instance_url=config.getBaseURL(),
         language=config.getDefaultLocale(),
         operating_system=get_os(),
         postgres_version=get_postgres_version(),
         python_version=platform.python_version(),
         hub_url=hub_url)