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