mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
fixed migrations
This commit is contained in:
@@ -28,7 +28,7 @@ def set_default_search_vector(apps, schema_editor):
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('auth', '0012_alter_user_first_name_max_length'),
|
('auth', '0012_alter_user_first_name_max_length'),
|
||||||
('cookbook', '0123_invitelink_email'),
|
('cookbook', '0126_alter_userpreference_theme'),
|
||||||
]
|
]
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
@@ -13,7 +13,7 @@ def create_searchfields(apps, schema_editor):
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('cookbook', '0124_build_full_text_index'),
|
('cookbook', '0127_build_full_text_index'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@@ -96,7 +96,7 @@ class FuzzyFilterMixin(ViewSetMixin):
|
|||||||
query = self.request.query_params.get('query', None)
|
query = self.request.query_params.get('query', None)
|
||||||
fuzzy = self.request.user.searchpreference.lookup
|
fuzzy = self.request.user.searchpreference.lookup
|
||||||
|
|
||||||
if query is not None or query != '':
|
if query is not None and query != '':
|
||||||
if fuzzy:
|
if fuzzy:
|
||||||
queryset = queryset.annotate(trigram=TrigramSimilarity('name', query)).filter(trigram__gt=0.2).order_by("-trigram")
|
queryset = queryset.annotate(trigram=TrigramSimilarity('name', query)).filter(trigram__gt=0.2).order_by("-trigram")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user