mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-05-26 21:33:58 +00:00
Attempting to fix issues with resolving nullable foreign keys.
This commit is contained in:
parent
3f5be2f11b
commit
5c22c17c6e
2 changed files with 4 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,3 +11,4 @@ Thumbs.db
|
|||
/MANIFEST
|
||||
/dist
|
||||
*.sqlite3
|
||||
*.egg-info
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ class SearchAdapter(object):
|
|||
name_parts = name.split("__", 1)
|
||||
prefix = name_parts[0]
|
||||
# Get the attribute.
|
||||
if hasattr(obj, prefix):
|
||||
if obj is None:
|
||||
return ""
|
||||
elif hasattr(obj, prefix):
|
||||
value = getattr(obj, prefix)
|
||||
if not isinstance(value, (QuerySet, models.Manager)):
|
||||
if callable(value):
|
||||
|
|
|
|||
Loading…
Reference in a new issue