fix recursion in django 1.5