use url_for instead of hard-coding urls

Bug #700202 reported by Thomi Richards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sloecode
Status tracked in Trunk
Trunk
Fix Released
Low
Unassigned

Bug Description

ANywhere in the code that we currently hard-code URLs (both in jinja2 template files and controllers) we need to be using the url_for function, which will allow us to move controllers around without breaking stuff.

Tags: trivial

Related branches

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

This has been done for all the admin templates. Non-admin templates still need to be done.

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Pylons 0.97 has deprecated the url_for function, in preference to the 'url' function. It works similarly, with a few differences:

1) It doesn't remember the current route, so all parts of the target have to be specified.
2) You can pass URLs to it and it will prepend the WSGI SCRIPT_NAME environment variable.

Using 'url' for EVERY URL link allows us to host sloecode at different prefixes (such as '/sloecode/' or similar). I have run sloecode at a custom prefix and verified that everything seems to work (after a lot of template tweaking).

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

I'm 99% certain that all URLs are now properly created. We'll need to keep an eye on this in the future however.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.