

def render(self, context):
    try:
        obj = self.obj.resolve(context)
    except template.VariableDoesNotExist:
        return ''
    try:
        prefix = self.get_prefix(obj)
    except (AttributeError, KeyError):
        return ''
    tinyid = converter.from_decimal(obj.pk)
    if (hasattr(settings, 'SHORT_BASE_URL') and settings.SHORT_BASE_URL):
        return urlparse.urljoin(settings.SHORT_BASE_URL, (prefix + tinyid))
    try:
        return urlresolvers.reverse('shorturls.views.redirect', kwargs={
            'prefix': prefix,
            'tiny': tinyid,
        })
    except urlresolvers.NoReverseMatch:
        return ''

dataset/ETHPy150Open bfirsh/django-shorturls/src/shorturls/templatetags/shorturl.py ShortURL.render/original