Bugfix for modern django versions