#16502: CreateView useless error message when template_name is not specified
-------------------------------------+-------------------------------------
     Reporter:  silverghost3@…       |                    Owner:  krak3n
         Type:  Bug                  |                   Status:  closed
    Component:  Generic views        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  CreateView "generic  |  worksforme
  view"                              |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by krak3n):

 * status:  assigned => closed
 * needs_better_patch:  1 => 0
 * resolution:   => worksforme


Comment:

 I was unable to duplicate this in 1.5.1.

 I created a basic model as below:

 {{{
 #!div style="font-size: 80%"
 #models.py
 }}}
 {{{#!python
 from django.db import models

 class Author(models.Model):
     name = models.CharField(max_length=100)
 }}}

 A basic view:
 {{{
 #!div style="font-size: 80%"
 #views.py
 }}}
 {{{#!python
 from django.views.generic import CreateView
 from .models import Author

 class CreateAuthor(CreateView):
     model = Author
 }}}

 The traceback I got back was:

 {{{
 TemplateDoesNotExist at /
 test_16502/author_form.html
 Request Method: GET
 Request URL:    http://10.10.10.10:9000/
 Django Version: 1.5.1
 Exception Type: TemplateDoesNotExist
 Exception Value:
 test_16502/author_form.html
 Exception Location:
 /home/vagrant/django/django/django/template/loader.py in select_template,
 line 194
 Python Executable:      /home/vagrant/.virtualenvs/django/bin/python
 Python Version: 2.7.3
 }}}

 I think this is the correct exception that should be raised and the
 exception is present in the regular debug view.

 Perhaps this was an issue with earlier versions of Django and it's been
 resolved in another ticket, though I can't hunt this down. Perhaps related
 to ticket:16866?

 Perhaps if this is still a bug provide more information on how to
 reproduce it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16502#comment:20>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to