Fix compatibility problem in pre-1.4 Django