Ticket #2374: templatevalidator.diff

File templatevalidator.diff, 1.2 KB (added by mattimustang@…, 18 years ago)

template validator patch

  • django/contrib/admin/views/template.py

     
    2222        new_data = request.POST.copy()
    2323        errors = manipulator.get_validation_errors(new_data)
    2424        if not errors:
    25             request.user.add_message('The template is valid.')
     25            request.user.message_set.create(message='The template is valid.')
    2626    return render_to_response('admin/template_validator.html', {
    2727        'title': 'Template validator',
    2828        'form': forms.FormWrapper(manipulator, new_data, errors),
     
    3232class TemplateValidator(forms.Manipulator):
    3333    def __init__(self, settings_modules):
    3434        self.settings_modules = settings_modules
    35         site_list = Site.objects.get_in_bulk(settings_modules.keys()).values()
     35        site_list = Site.objects.in_bulk(settings_modules.keys()).values()
    3636        self.fields = (
    3737            forms.SelectField('site', is_required=True, choices=[(s.id, s.name) for s in site_list]),
    3838            forms.LargeTextField('template', is_required=True, rows=25, validator_list=[self.isValidTemplate]),
Back to Top