706 | | if callable(current): |
707 | | if getattr(current, 'alters_data', False): |
708 | | current = settings.TEMPLATE_STRING_IF_INVALID |
709 | | else: |
710 | | try: # method call (assuming no args required) |
711 | | current = current() |
712 | | except TypeError: # arguments *were* required |
713 | | # GOTCHA: This will also catch any TypeError |
714 | | # raised in the function itself. |
715 | | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
716 | | except Exception, e: |
717 | | if getattr(e, 'silent_variable_failure', False): |
718 | | current = settings.TEMPLATE_STRING_IF_INVALID |
719 | | else: |
720 | | raise |
| 720 | if callable(current): |
| 721 | if getattr(current, 'alters_data', False): |
| 722 | current = settings.TEMPLATE_STRING_IF_INVALID |
| 723 | else: |
| 724 | try: # method call (assuming no args required) |
| 725 | current = current() |
| 726 | except TypeError: # arguments *were* required |
| 727 | # GOTCHA: This will also catch any TypeError |
| 728 | # raised in the function itself. |
| 729 | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
| 730 | except Exception, e: |
| 731 | if getattr(e, 'silent_variable_failure', False): |
| 732 | current = settings.TEMPLATE_STRING_IF_INVALID |
| 733 | else: |
| 734 | raise |