fix a bug with django 1.5