##// END OF EJS Templates
backported fix for issue with uploading files from web interface
marcink -
r1962:1ce36a5f default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7
7
8 :created_on: Apr 9, 2010
8 :created_on: Apr 9, 2010
9 :author: marcink
9 :author: marcink
10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
11 :license: GPLv3, see COPYING for more details.
12 """
12 """
13 # This program is free software: you can redistribute it and/or modify
13 # This program is free software: you can redistribute it and/or modify
@@ -26,6 +26,7 b' import os'
26 import time
26 import time
27 import traceback
27 import traceback
28 import logging
28 import logging
29 import cStringIO
29
30
30 from sqlalchemy.exc import DatabaseError
31 from sqlalchemy.exc import DatabaseError
31
32
@@ -370,8 +371,12 b' class ScmModel(BaseModel):'
370
371
371 if isinstance(content, (basestring,)):
372 if isinstance(content, (basestring,)):
372 content = safe_str(content)
373 content = safe_str(content)
373 elif isinstance(content, file):
374 elif isinstance(content, (file, cStringIO.OutputType,)):
374 content = content.read()
375 content = content.read()
376 else:
377 raise Exception('Content is of unrecognized type %s' % (
378 type(content)
379 ))
375
380
376 message = safe_str(message)
381 message = safe_str(message)
377 path = safe_str(f_path)
382 path = safe_str(f_path)
General Comments 0
You need to be logged in to leave comments. Login now