﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13609	Using a non existent template in admin.Inlines produce error when posting the form	Lucio Asnaghi	Jonas Obrist	"I'm using some Staked and Tabular Inline with a custom template.

{{{
class AppointmentInline(InlineAutocompleteAdmin):
    model = Appointment
    extra = 0
    template = 'my/non/existent/template/tabular.html'
}}}

When the template i'm specifying doesn't exists, the inlines doesn't show up in the admin change_form (no error is produced even in DEBUG mode): this way when i post the form data to save the model, i always get an error:

{{{
ValidationError at /admin/test/event/1/

Request Method: 	POST
Request URL: 	http://127.0.0.1:8000/admin/test/event/1/
Django Version: 	1.2 beta 1
Exception Type: 	ValidationError
Exception Value: 	

Exception Location: 	.../thirdparty/django-1.2/django/forms/formsets.py in _management_form, line 57
Python Executable: 	/usr/bin/python2.6
Python Version: 	2.6.2
Python Path: 	[...]
Server time: 	Tue, 25 May 2010 10:39:10 +0200

...

../thirdparty/django-1.2/django/forms/formsets.py  in _management_form

  50. return self.as_table()
  51.
  52. def _management_form(self):
  53. """"""Returns the ManagementForm instance for this FormSet.""""""
  54. if self.data or self.files:
  55. form = ManagementForm(self.data, auto_id=self.auto_id, prefix=self.prefix)
  56. if not form.is_valid():

  57. raise ValidationError('ManagementForm data is missing or has been tampered with') ...

  58. else:
  59. form = ManagementForm(auto_id=self.auto_id, prefix=self.prefix, initial={
  60. TOTAL_FORM_COUNT: self.total_form_count(),
  61. INITIAL_FORM_COUNT: self.initial_form_count(),
  62. MAX_NUM_FORM_COUNT: self.max_num
  63. })
}}}


I think when resolving the template of an inline, django should at least report with an error that the specified template doesn't exists."		closed	contrib.admin	1.2-beta		fixed	Inline custom template ValidationError ManagementForm data missing tampered		Ready for checkin	1	0	0	0	0	0
