mirror of
https://github.com/golang/go
synced 2024-11-21 23:14:40 -07:00
godashboard: support submitting projects with non-ascii names
Fixes #1314. R=adg, rsc CC=golang-dev https://golang.org/cl/3459043
This commit is contained in:
parent
fec6ab9726
commit
5742ded3ad
@ -30,6 +30,11 @@ import time
|
|||||||
import urllib2
|
import urllib2
|
||||||
import sets
|
import sets
|
||||||
|
|
||||||
|
# local imports
|
||||||
|
import toutf8
|
||||||
|
|
||||||
|
template.register_template_library('toutf8')
|
||||||
|
|
||||||
# Storage model for package info recorded on server.
|
# Storage model for package info recorded on server.
|
||||||
# Just path, count, and time of last install.
|
# Just path, count, and time of last install.
|
||||||
class Package(db.Model):
|
class Package(db.Model):
|
||||||
|
@ -5,5 +5,5 @@ Description: {{project.descr}}
|
|||||||
URL: {{project.web_url}}
|
URL: {{project.web_url}}
|
||||||
|
|
||||||
To edit/approve/delete:
|
To edit/approve/delete:
|
||||||
http://godashboard.appspot.com/project/edit?name={{project.name|urlencode}}
|
http://godashboard.appspot.com/project/edit?name={{project.name|toutf8|urlencode}}
|
||||||
|
|
||||||
|
14
misc/dashboard/godashboard/toutf8.py
Normal file
14
misc/dashboard/godashboard/toutf8.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Copyright 2010 The Go Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style
|
||||||
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
# This is a Django custom template filter to work around the
|
||||||
|
# fact that GAE's urlencode filter doesn't handle unicode strings.
|
||||||
|
|
||||||
|
from google.appengine.ext import webapp
|
||||||
|
|
||||||
|
register = webapp.template.create_template_register()
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def toutf8(value):
|
||||||
|
return value.encode("utf-8")
|
Loading…
Reference in New Issue
Block a user