def us_phonenumber_tag(number): """ This is for backward compatibility. Don't use it. """ import warnings warnings.simplefilter("always", "You're using us_phonenumber tag. You " "should use a the filter with the same name.", DeprecationWarning) return format_us_phonenumber(number)
def us_phonenumber_filter(value): try: return format_us_phonenumber(value) except phonenumbers.NumberParseException: # XXX: Swallow the exception return value