[FIX] pad: etherpad limits pad id length to 50

See https://github.com/ether/etherpad-lite/issues/1116
This commit is contained in:
Denis Ledoux 2014-12-08 14:46:11 +01:00
parent aa10972d13
commit 284ca73b1c
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ class pad_common(osv.osv_memory):
s = string.ascii_uppercase + string.digits
salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
#path
path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt)
# etherpad hardcodes pad id length limit to 50
path = '-%s-%s' % (self._name, salt)
path = '%s%s' % (cr.dbname.replace('_','-')[0:50 - len(path)], path)
# contruct the url
url = '%s/p/%s' % (pad["server"], path)