fix a template bug for specific versions of django