Fixed broken code due to the change to django 1.5.1