Exemple #1
0
def expand(request):
    shortenkey = request.matchdict['shortenkey']
    try:
        url = expand_shortenkey(shortenkey)
    except (InvalidShortenKey, ShortenKeyDoesNotExist):
        raise HTTPNotFound

    return HTTPMovedPermanently(location=url)
Exemple #2
0
 def _callFUT(self, *args, **kwargs):
     from foomn.shortenkey import expand_shortenkey
     return expand_shortenkey(*args, **kwargs)