diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/package_extras.py | 7 | ||||
-rw-r--r-- | packages/urls.py | 2 | ||||
-rw-r--r-- | packages/views/__init__.py | 2 | ||||
-rw-r--r-- | packages/views/flag.py | 6 |
4 files changed, 10 insertions, 7 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 71ff5ed8..2e68ef0c 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -9,8 +9,11 @@ from django.utils.html import escape register = template.Library() -def link_encode(url, query, doseq=False): - data = urlencode(query, doseq).replace('&', '&') +def link_encode(url, query): + # massage the data into all utf-8 encoded strings first, so urlencode + # doesn't barf at the data we pass it + query = dict((k, unicode(v).encode('utf-8')) for k, v in query.items()) + data = urlencode(query).replace('&', '&') return "%s?%s" % (url, data) @register.filter diff --git a/packages/urls.py b/packages/urls.py index 6c616297..52b09d2c 100644 --- a/packages/urls.py +++ b/packages/urls.py @@ -28,7 +28,7 @@ urlpatterns = patterns('packages.views', (r'^stale_relations/$', 'stale_relations'), (r'^stale_relations/update/$','stale_relations_update'), - (r'^(?P<name>[A-z0-9\-+.]+)/$', + (r'^(?P<name>[^ /]+)/$', 'details'), (r'^(?P<repo>[A-z0-9\-]+)/(?P<name>[^ /]+)/$', 'details'), diff --git a/packages/views/__init__.py b/packages/views/__init__.py index 9ca21407..08e0286c 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -142,7 +142,7 @@ def details(request, name='', repo='', arch=''): ('q', name), ] # only include non-blank values in the query we generate - pkg_data = [(x, y) for x, y in pkg_data if y] + pkg_data = [(x, y.encode('utf-8')) for x, y in pkg_data if y] return redirect("/packages/?%s" % urlencode(pkg_data)) def groups(request, arch=None): diff --git a/packages/views/flag.py b/packages/views/flag.py index ad1b04db..e87cef69 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -18,9 +18,9 @@ def flaghelp(request): return direct_to_template(request, 'packages/flaghelp.html') class FlagForm(forms.Form): - email = forms.EmailField(label='* E-mail Address') - message = forms.CharField(label='Message To Dev', - widget=forms.Textarea, required=False) + email = forms.EmailField(label='E-mail Address') + message = forms.CharField(label='Message To Developer', + widget=forms.Textarea) # The field below is used to filter out bots that blindly fill out all # input elements website = forms.CharField(label='', |