~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to django/contrib/admin/views/template.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from django.conf import settings
7
7
from django.utils.importlib import import_module
8
8
from django.utils.translation import ugettext_lazy as _
 
9
from django.contrib import messages
9
10
 
10
11
 
11
12
def template_validator(request):
23
24
        form = TemplateValidatorForm(settings_modules, site_list,
24
25
                                     data=request.POST)
25
26
        if form.is_valid():
26
 
            request.user.message_set.create(message='The template is valid.')
 
27
            messages.info(request, 'The template is valid.')
27
28
    else:
28
29
        form = TemplateValidatorForm(settings_modules, site_list)
29
30
    return render_to_response('admin/template_validator.html', {
75
76
            error = e
76
77
        template.builtins.remove(register)
77
78
        if error:
78
 
            raise forms.ValidationError, e.args
 
79
            raise forms.ValidationError(e.args)