SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 0132e33e authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Disable trigram extension in db

parent 28b7be01
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ import re
from django import forms
from django.conf import settings
from django.contrib.postgres.search import TrigramSimilarity
# from django.contrib.postgres.search import TrigramSimilarity
from django.db import transaction
from django.db.models import Q
from django.forms.formsets import ORDERING_FIELD_NAME
......@@ -914,9 +914,11 @@ class RefereeSearchForm(forms.Form):
'placeholder': 'Search for a referee in the SciPost Profiles database'}))
def search(self):
return Profile.objects.annotate(
similarity=TrigramSimilarity('last_name', self.cleaned_data['last_name']),
).filter(similarity__gt=0.3).order_by('-similarity')
return Profile.objects.filter(
last_name__icontains=self.cleaned_data['last_name'])
# return Profile.objects.annotate(
# similarity=TrigramSimilarity('last_name', self.cleaned_data['last_name']),
# ).filter(similarity__gt=0.3).order_by('-similarity')
class ConsiderRefereeInvitationForm(forms.Form):
......
......@@ -3,7 +3,7 @@
from __future__ import unicode_literals
from django.db import migrations
from django.contrib.postgres.operations import TrigramExtension
# from django.contrib.postgres.operations import TrigramExtension
class Migration(migrations.Migration):
......@@ -13,5 +13,5 @@ class Migration(migrations.Migration):
]
operations = [
TrigramExtension(),
# TrigramExtension(),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment