689 | | if callable(current): |
690 | | if getattr(current, 'alters_data', False): |
691 | | current = settings.TEMPLATE_STRING_IF_INVALID |
692 | | else: |
693 | | try: # method call (assuming no args required) |
694 | | current = current() |
695 | | except TypeError: # arguments *were* required |
696 | | # GOTCHA: This will also catch any TypeError |
697 | | # raised in the function itself. |
698 | | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
699 | | except Exception, e: |
700 | | if getattr(e, 'silent_variable_failure', False): |
701 | | current = settings.TEMPLATE_STRING_IF_INVALID |
702 | | else: |
703 | | raise |
| 703 | |
| 704 | if callable(current): |
| 705 | if getattr(current, 'alters_data', False): |
| 706 | current = settings.TEMPLATE_STRING_IF_INVALID |
| 707 | else: |
| 708 | try: # method call (assuming no args required) |
| 709 | current = current() |
| 710 | except TypeError: # arguments *were* required |
| 711 | # GOTCHA: This will also catch any TypeError |
| 712 | # raised in the function itself. |
| 713 | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
| 714 | except Exception, e: |
| 715 | if getattr(e, 'silent_variable_failure', False): |
| 716 | current = settings.TEMPLATE_STRING_IF_INVALID |
| 717 | else: |
| 718 | raise |