BEN-2299 fix filer error: maximum recursion depth exceeded  while hard deleting a folder
BEN-2299 fix filer error: maximum recursion depth exceeded  while hard deleting a folder

In the newer django version (2.2), the MPTTModel.delete() methods now calls django.db.models.base.Model.refresh_from_db, which in turn calls the constructor of the Folder model (django-filer/filer/models/foldermodels.py:Folder). At that moment, almost all of the fields are DEFERRED, trying to acces them will trigger again django.db.models.base.Model.refresh_from_db, thus the infinite loop.

The fix: set the 'cached' props only if fields are fetched from DB.

pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer