summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-20 23:50:21 -0500
committerDan McGee <dan@archlinux.org>2012-08-20 23:50:21 -0500
commitcd51842ce86c44eef4e3c3d5334aca13e234151a (patch)
tree7d1fa488720677a94a9ed264775d5285c5b83bc1 /packages
parent78553abc51ba0f18e1c3bec015c9a11d4760c522 (diff)
Fix scm_link for Unicode characters
This blew up with non-ASCII due to us trying to stuff 8-bit characters into the URL parameters where they aren't allowed. Tested with a package entered via the admin with pkgname and pkgbase set to 'αναζήτη'. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/templatetags/package_extras.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index 9daecd96..a0ee8bee 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -91,11 +91,12 @@ def packager_link(user):
@register.simple_tag
def scm_link(package, operation):
- parts = (package.repo.svn_root, operation, package.pkgbase)
- linkbase = (
- "https://projects.archlinux.org/svntogit/%s.git/%s/trunk?"
- "h=packages/%s")
- return linkbase % tuple(urlquote(part) for part in parts)
+ parts = (package.repo.svn_root, operation)
+ url = "https://projects.archlinux.org/svntogit/%s.git/%s/trunk" % parts
+ data = {
+ 'h': 'packages/%s' % package.pkgbase
+ }
+ return link_encode(url, data)
@register.simple_tag
def get_wiki_link(package):