#16502: CreateView useless error message when template_name is not specified -------------------------------------+------------------------------------- Reporter: | Owner: Silver_Ghost silverghost3@… | Status: assigned Type: Bug | Component: Generic views Milestone: | Severity: Normal Version: 1.3 | Keywords: CreateView "generic Resolution: | view" Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- Changes (by Silver_Ghost):
* status: new => assigned * owner: nobody => Silver_Ghost * stage: Unreviewed => Accepted Comment: ''aaugustin'', through information from your comment I was able to find possible place in code where additional check could be perfomed. It is `django.template.loader.select_template` function. It expects list of template names and select first loadable. If there are some template names in list and no one from them couldn't be loaded then raising `TemplateDoesNotExist` exception is the right decision since. But if there isn't any template names in the list then >>Template<<DoesNotExist is wrong exception, I think. So maybe checks if list is empty and raise exception with message like "I can't load any template for you because you didn't gave me any possible variants"? -- Ticket URL: <https://code.djangoproject.com/ticket/16502#comment:2> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.