You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Hello community. I need to support some legacy URLs in a web2py application. I am able to do this using routes_in and routes_out, but it fails when the URL contains a question mark:
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Aren't those available in request.args[] rather than being left in the URL? That is, some parsing of the URL is done before this point.
/dps
nethu...@gmail.com
unread,
Feb 16, 2018, 9:07:20 AM2/16/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
I think URL mapping occurs before. However I don't care about the lang value itself, just want to support a legacy URL.
Anthony
unread,
Feb 16, 2018, 11:21:14 AM2/16/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Unfortunately, the rewrite system does not match on the query string. Some options are:
Use your web server to do the rewrite.
Implement WSGI middleware to do the rewrite (or at least rewrite the legacy URLs in a way that the web2py rewrite system can then match them, such as moving the language values from the query string to the URL path). See http://web2py.com/books/default/chapter/29/04/the-core#External-middleware.
Add code in a model file to identify these URLs (possibly after a rewrite, which could add an obvious flag to the path) and manually change request.function, request.args, etc. to direct to the appropriate controller. Most of the code and configuration could go in external modules.
Direct the different languages to a single function and simply use the value in request.get_vars to determine the appropriate content.
Anthony
nethu...@gmail.com
unread,
Feb 16, 2018, 5:53:39 PM2/16/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Thanks Anthony, I'll try with one of those workarounds.