utils: Handle removal of axes.get_version()

This was removed from django-axes 5.0.13 with introduction of
setuptools-scm.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2020-05-25 14:31:20 -04:00 committed by Sunil Mohan Adapa
parent bb3b32fd69
commit f46b7ae2a6
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -149,4 +149,10 @@ def is_axes_old():
"""
import axes
return LooseVersion(axes.get_version()) < LooseVersion('5.0')
try:
version = axes.get_version()
except AttributeError:
# axes.get_version() was removed in 5.0.13
return False
return LooseVersion(version) < LooseVersion('5.0')