fix for https://github.com/divio/django-cms/issues/3563

backport changes to 3.0.X