diff --git a/submissions/forms.py b/submissions/forms.py index 2b202e062d9f152d68b58b655fa11dcb243c6c0e..48c05b872b648868efc2442a10389c52ca325516 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -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): diff --git a/submissions/migrations/0050_auto_20181219_0825.py b/submissions/migrations/0050_auto_20181219_0825.py index 9495f00fac4ef28add4a1bd3f117c0ed804a0316..96aa0a24aab7ff47caa5cbab304ef021b33ea4a5 100644 --- a/submissions/migrations/0050_auto_20181219_0825.py +++ b/submissions/migrations/0050_auto_20181219_0825.py @@ -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(), ]