@register.function
def license_link(license):
    # If passed in an integer, try to look up the License.
    from olympia.versions.models import License
    if isinstance(license, (long, int)):
        if license in PERSONA_LICENSES_IDS:
            # Grab built-in license.
            license = PERSONA_LICENSES_IDS[license]
        else:
            # Grab custom license.
            license = License.objects.filter(id=license)
            if not license.exists():
                return ''
            license = license[0]
    elif not license:
        return ''

    if not getattr(license, 'builtin', True):
        return _('Custom License')

    template = get_env().get_template('amo/license_link.html')
    return jinja2.Markup(template.render({'license': license}))
Return a decorator that marks callables as deprecated.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/amo/helpers.py/license_link--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/python/deprecate.py/deprecated