#24960: Blank pages due to {{ block.super }} -------------------------------------+------------------------------------- Reporter: srkunze | Owner: nobody Type: Bug | Status: new Component: Template system | Version: master Severity: Normal | Resolution: Keywords: block.super blank | Triage Stage: pages | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 1 -------------------------------------+-------------------------------------
Comment (by srkunze): In Django 1.6, render_to_string does not work. Maybe, in Django 1.8 this is also another convenience layer. Well, not sure if Django 1.8 fixes the original issue. Infact, when programming, we simply do not know which errors might occur. So, just because Django re-raises TypeErrors now, does not necessarily mean that we cover all cases (all types of errors). As soon as somebody raises another exception that is not covered, we are going to see a blank page again. So, our suggestion was: why not check if the given context variable might work in the first place? Right now, all Django versions just call the variables, do the attribute, do the list access etc. So, we mix up both cases: 1. wrong access or 2. internal error when evaluating cf. https://github.com/django/django/blob/1.8.2/django/template/base.py#L804 We actually do not want an ever-growing list of Errors (TypeError, AttributeError, KeyError, ValueError, IndexError -- as you can see in base.py) but a clean long-lasting solution. For instance, Python provides the function 'has_attr' which can be used to check whether an object has a certain attribute or not. The same goes for list access and function calls. -- Ticket URL: <https://code.djangoproject.com/ticket/24960#comment:8> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.1c87cd5de8d443f19fd8e9de359fc1b0%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.