mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-23 18:29:23 -05:00
no more unaccent on sqlite
This commit is contained in:
@@ -307,7 +307,7 @@ class FuzzyFilterMixin(viewsets.ModelViewSet, ExtendedRecipeMixin):
|
|||||||
filter = Q(name__icontains=query)
|
filter = Q(name__icontains=query)
|
||||||
if self.request.user.is_authenticated:
|
if self.request.user.is_authenticated:
|
||||||
if any([self.model.__name__.lower() in x for x in
|
if any([self.model.__name__.lower() in x for x in
|
||||||
self.request.user.searchpreference.unaccent.values_list('field', flat=True)]):
|
self.request.user.searchpreference.unaccent.values_list('field', flat=True)]) and (settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql'):
|
||||||
filter |= Q(name__unaccent__icontains=query)
|
filter |= Q(name__unaccent__icontains=query)
|
||||||
|
|
||||||
self.queryset = (
|
self.queryset = (
|
||||||
|
|||||||
@@ -675,16 +675,4 @@ DISABLE_EXTERNAL_CONNECTORS = extract_bool('DISABLE_EXTERNAL_CONNECTORS', False)
|
|||||||
EXTERNAL_CONNECTORS_QUEUE_SIZE = int(os.getenv('EXTERNAL_CONNECTORS_QUEUE_SIZE', 100))
|
EXTERNAL_CONNECTORS_QUEUE_SIZE = int(os.getenv('EXTERNAL_CONNECTORS_QUEUE_SIZE', 100))
|
||||||
|
|
||||||
mimetypes.add_type("text/javascript", ".js", True)
|
mimetypes.add_type("text/javascript", ".js", True)
|
||||||
mimetypes.add_type("text/javascript", ".mjs", True)
|
mimetypes.add_type("text/javascript", ".mjs", True)
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
|
||||||
'HOST': 'localhost',
|
|
||||||
'PORT': 5432,
|
|
||||||
'USER': 'postgres',
|
|
||||||
'PASSWORD': 'mrDJJpbMC9znd4xwVz2a',
|
|
||||||
'NAME': 'tandoor_test_db',
|
|
||||||
'CONN_MAX_AGE': 60,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user