mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-12 19:10:59 +00:00
Cleanup usages of get_field_by_name in search
This commit is contained in:
parent
6dfa1aad01
commit
381bd10665
2 changed files with 3 additions and 3 deletions
|
|
@ -43,8 +43,8 @@ class DBSearchQuery(BaseSearchQuery):
|
|||
for field_name in fields:
|
||||
# Check if the field exists (this will filter out indexed callables)
|
||||
try:
|
||||
model._meta.get_field_by_name(field_name)
|
||||
except:
|
||||
model._meta.get_field(field_name)
|
||||
except models.fields.FieldDoesNotExist:
|
||||
continue
|
||||
|
||||
# Filter on this field
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class BaseField(object):
|
|||
self.kwargs = kwargs
|
||||
|
||||
def get_field(self, cls):
|
||||
return cls._meta.get_field_by_name(self.field_name)[0]
|
||||
return cls._meta.get_field(self.field_name)
|
||||
|
||||
def get_attname(self, cls):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue