diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index 584bde7db5..4276c2aabf 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
@@ -29,6 +29,8 @@ from django.core.paginator import Paginator, EmptyPage | |||
29 | from django.db.models import Q | 29 | from django.db.models import Q |
30 | from orm.models import Project, ProjectLayer, Layer_Version | 30 | from orm.models import Project, ProjectLayer, Layer_Version |
31 | from django.template import Context, Template | 31 | from django.template import Context, Template |
32 | from django.template import VariableDoesNotExist | ||
33 | from django.template import TemplateSyntaxError | ||
32 | from django.core.serializers.json import DjangoJSONEncoder | 34 | from django.core.serializers.json import DjangoJSONEncoder |
33 | from django.core.exceptions import FieldError | 35 | from django.core.exceptions import FieldError |
34 | from django.conf.urls import url, patterns | 36 | from django.conf.urls import url, patterns |
@@ -349,10 +351,20 @@ class ToasterTable(TemplateView): | |||
349 | # so that this can be used as the html class name | 351 | # so that this can be used as the html class name |
350 | col['field_name'] = col['static_data_name'] | 352 | col['field_name'] = col['static_data_name'] |
351 | 353 | ||
352 | # Render the template given | 354 | try: |
353 | required_data[col['static_data_name']] = \ | 355 | # Render the template given |
354 | self.render_static_data( | 356 | required_data[col['static_data_name']] = \ |
355 | col['static_data_template'], model_obj) | 357 | self.render_static_data( |
358 | col['static_data_template'], model_obj) | ||
359 | except (TemplateSyntaxError, | ||
360 | VariableDoesNotExist) as e: | ||
361 | logger.error("could not render template code" | ||
362 | "%s %s %s", | ||
363 | col['static_data_template'], | ||
364 | e, self.__class__.__name__) | ||
365 | required_data[col['static_data_name']] =\ | ||
366 | '<!--error-->' | ||
367 | |||
356 | else: | 368 | else: |
357 | # Traverse to any foriegn key in the field | 369 | # Traverse to any foriegn key in the field |
358 | # e.g. recipe__layer_version__name | 370 | # e.g. recipe__layer_version__name |