mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-14 18:23:14 +00:00
19 lines
647 B
Python
19 lines
647 B
Python
from django.apps import AppConfig
|
|
from django.core.checks import Error, Tags, register
|
|
|
|
from .utils import get_postgresql_connections, set_weights
|
|
|
|
|
|
class PostgresSearchConfig(AppConfig):
|
|
name = 'wagtail.contrib.postgres_search'
|
|
|
|
def ready(self):
|
|
@register(Tags.compatibility, Tags.database)
|
|
def check_if_postgresql(app_configs, **kwargs):
|
|
if get_postgresql_connections():
|
|
return []
|
|
return [Error('You must use a PostgreSQL database '
|
|
'to use PostgreSQL search.',
|
|
id='wagtail.contrib.postgres_search.E001')]
|
|
|
|
set_weights()
|