fixed TypeError in compile_messages() with Django 1.6