mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-20 02:26:12 +00:00
Fail if search plugin is loaded but no engines
This commit is contained in:
parent
f487f0f8de
commit
bb32bcef8f
@ -16,7 +16,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from flask import request, session
|
||||
from flask import request
|
||||
from flask_pluginengine import current_plugin
|
||||
|
||||
from MaKaC.conference import ConferenceHolder, Conference, CategoryManager
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from flask_pluginengine import plugins_loaded
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
|
||||
from indico_search.blueprint import blueprint
|
||||
@ -30,6 +32,14 @@ class SearchPlugin(IndicoPlugin):
|
||||
hidden = True
|
||||
_engine_plugin = None # the search engine plugin
|
||||
|
||||
def init(self):
|
||||
super(SearchPlugin, self).init()
|
||||
self.connect(plugins_loaded, self._plugins_loaded, sender=self.app)
|
||||
|
||||
def _plugins_loaded(self, sender, **kwargs):
|
||||
if not self.engine_plugin:
|
||||
raise RuntimeError('Search plugin active but no search engine plugin loaded')
|
||||
|
||||
@property
|
||||
def engine_plugin(self):
|
||||
return self._engine_plugin
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user