Skip to content

Commit c152fcd

Browse files
committed
Fixed the case where index_name isn't available.
1 parent e0f26be commit c152fcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

haystack/indexes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def __new__(cls, name, bases, attrs):
6060
if not attrs.has_key('objects'):
6161
try:
6262
attrs['objects'] = HaystackManager(attrs['Meta'].index_label)
63-
except KeyError:
63+
except (KeyError, AttributeError):
6464
attrs['objects'] = HaystackManager(DEFAULT_ALIAS)
65-
65+
6666
return super(DeclarativeMetaclass, cls).__new__(cls, name, bases, attrs)
6767

6868

0 commit comments

Comments
 (0)