liberation / django-elasticsearch

Simple wrapper around elasticsearch-py to index/search a django Model.
MIT License
211 stars 73 forks source link

es_syncdb_callback not works 1.10+ #73

Open M1ha-Shvn opened 7 years ago

M1ha-Shvn commented 7 years ago

The bug is in models.py => es_syncdb_callback(), line 81: if int(get_version()[2]) > 6: returns False for django 1.10 and 1.11 as it gets 1 > 6 not 11 > 6... The correct code (for support of django 1.10+ and django 2.0+) is:

v = get_version().split('.')
if int(v[0]) > 1 or int(v[1]) > 6 
lauxley commented 7 years ago

Thx !