# HG changeset patch # User Sverre Rabbelier # Date 1256510390 25200 # Node ID b6b5ad155dd9ef78abe745b0a52a19c791da33f8 # Parent 7c63279401af89f996a42717659033f49009b010 Add a redirectLegacyRequest response diff -r 7c63279401af -r b6b5ad155dd9 app/soc/views/helper/responses.py --- a/app/soc/views/helper/responses.py Sun Oct 25 15:39:38 2009 -0700 +++ b/app/soc/views/helper/responses.py Sun Oct 25 15:39:50 2009 -0700 @@ -208,3 +208,15 @@ return respond(request, sibling_templates, context=context, response_args=error.response_args) + + +def redirectLegacyRequest(request, *args, **kwargs): + """Redirects a request to a legacy url to the new '/gsoc' suffix. + + Args: + request: a Django HTTP request + """ + + url = '/gsoc' + request.path + + return http.HttpResponseRedirect(url)