Skip to content

Commit b739157

Browse files
committed
Fixed #62
Assume no value on AttributeError which can happen when a related field doesn't exist and we attempt to get a property from it
1 parent 56b5a03 commit b739157

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

report_builder/templates/admin/report_builder/report/change_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<script>
66
(function($) {$('<input type="submit" name="_easy" value="Save and continue to easy edit"/>').appendTo('.submit-row');})(django.jQuery);
77

8-
$('<li><input type="submit" class="grp-button grp-default" name="_easy" value="Save and continue to easy edit"/></li>').appendTo('footer ul');
8+
$('<li><input type="submit" class="grp-button grp-default" name="_easy" value="Save and Start Building Report"/></li>').appendTo('footer ul');
99

1010
</script>
1111
{% endblock %}

report_builder/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ def increment_total(display_field_key, display_totals, val):
467467
else:
468468
val = None
469469
else:
470-
val = reduce(getattr, relations, obj)
470+
try:
471+
val = reduce(getattr, relations, obj)
472+
except AttributeError:
473+
val = None
471474
values_and_properties_list[-1].insert(position, val)
472475
increment_total(display_property, display_totals, val)
473476
for position, display_custom in custom_list.iteritems():

0 commit comments

Comments
 (0)