Merge lp:~therp-nl/openerp-web/web-7.0_lp1193563_typeerror-expected_bytes into lp:openerp-web/7.0

Proposed by Ronald Portier (Therp)
Status: Merged
Merge reported by: Nicolas Vanhoren (OpenERP)
Merged at revision: not available
Proposed branch: lp:~therp-nl/openerp-web/web-7.0_lp1193563_typeerror-expected_bytes
Merge into: lp:openerp-web/7.0
Diff against target: 38 lines (+4/-4)
1 file modified
addons/web/controllers/main.py (+4/-4)
To merge this branch: bzr merge lp:~therp-nl/openerp-web/web-7.0_lp1193563_typeerror-expected_bytes
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+173796@code.launchpad.net

Description of the change

Replace int(token) by simply token on strings used to create a fileToken cookie.

Prevents crash with newer versions of Werkzeug.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/controllers/main.py'
2--- addons/web/controllers/main.py 2013-07-02 12:20:14 +0000
3+++ addons/web/controllers/main.py 2013-07-09 19:21:27 +0000
4@@ -812,7 +812,7 @@
5 return req.make_response(db_dump,
6 [('Content-Type', 'application/octet-stream; charset=binary'),
7 ('Content-Disposition', content_disposition(filename, req))],
8- {'fileToken': int(token)}
9+ {'fileToken': token}
10 )
11 except xmlrpclib.Fault, e:
12 return simplejson.dumps([[],[{'error': e.faultCode, 'title': _('Backup Database')}]])
13@@ -1320,7 +1320,7 @@
14 return req.make_response(filecontent,
15 headers=[('Content-Type', 'application/octet-stream'),
16 ('Content-Disposition', content_disposition(filename, req))],
17- cookies={'fileToken': int(token)})
18+ cookies={'fileToken': token})
19
20 @openerpweb.httprequest
21 def upload(self, req, callback, ufile):
22@@ -1627,7 +1627,7 @@
23 headers=[('Content-Disposition',
24 content_disposition(self.filename(model), req)),
25 ('Content-Type', self.content_type)],
26- cookies={'fileToken': int(token)})
27+ cookies={'fileToken': token})
28
29 class CSVExport(ExportFormat, http.Controller):
30 _cp_path = '/web/export/csv'
31@@ -1767,6 +1767,6 @@
32 ('Content-Disposition', content_disposition(file_name, req)),
33 ('Content-Type', report_mimetype),
34 ('Content-Length', len(report))],
35- cookies={'fileToken': int(token)})
36+ cookies={'fileToken': token})
37
38 # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: