changeset 116:25723df2d237

dispatch: do not give unneeded args to endpoints not wanting them
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 13 Mar 2011 19:01:24 +0100
parents e330a698dea3
children 0553dfbec661
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sun Mar 13 17:34:50 2011 +0100
+++ b/MoinMoin/apps/frontend/views.py	Sun Mar 13 19:01:24 2011 +0100
@@ -50,6 +50,9 @@
 def dispatch():
     args = request.values.to_dict()
     endpoint = str(args.pop('endpoint'))
+    # filter args given to url_for, so that no unneeded args end up in query string:
+    args = dict([(k, args[k]) for k in args
+                 if app.url_map.is_endpoint_expecting(endpoint, k)])
     return redirect(url_for(endpoint, **args))