As in the Django 3.1 release notes is stated: "The compatibility import of django.core.exceptions.FieldDoesNotExist in django.db.models.fields is removed."
A possible fix for this is to import from django.core import exceptions and replace the following except (AttributeError, models.FieldDoesNotExist): with except (AttributeError, exceptions.FieldDoesNotExist):
The following line of code will cause issues in Django 3.1 and later: https://github.com/divio/aldryn-search/blob/a62715a07d296c117304a055202da417723a6dea/aldryn_search/utils.py#L125
As in the Django 3.1 release notes is stated: "The compatibility import of django.core.exceptions.FieldDoesNotExist in django.db.models.fields is removed."
A possible fix for this is to import
from django.core import exceptions
and replace the followingexcept (AttributeError, models.FieldDoesNotExist):
withexcept (AttributeError, exceptions.FieldDoesNotExist):