Changeset 10027 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 15 Mar 2013, 00:58:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9931 r10027 18 18 """ Viewing components for Kofa objects. 19 19 """ 20 import csv 20 # XXX: All csv ops should move to a dedicated module soon 21 import unicodecsv as csv 21 22 import grok 22 23 import os … … 1044 1045 # XXX: temporary solution to prevent users from 1045 1046 # uploading non-ascii files. 1046 for element in filecontent:1047 try:1048 if ord(element) > 128:1049 self.flash(_(1050 "Only ASCII files are allowed. "1051 "Your file contains non-ASCII characters."))1052 logger.info('%s - non-ascii file uploaded: %s' %1053 (ob_class, target))1054 return1055 except TypeError:1056 self.flash(_(1057 "Only ASCII files are allowed. "1058 "Your file contains non-ASCII characters."))1059 logger.info('%s - non-ascii file uploaded: %s' %1060 (ob_class, target))1061 return1047 #for element in filecontent: 1048 # try: 1049 # if ord(element) > 128: 1050 # self.flash(_( 1051 # "Only ASCII files are allowed. " 1052 # "Your file contains non-ASCII characters.")) 1053 # logger.info('%s - non-ascii file uploaded: %s' % 1054 # (ob_class, target)) 1055 # return 1056 # except TypeError: 1057 # self.flash(_( 1058 # "Only ASCII files are allowed. " 1059 # "Your file contains non-ASCII characters.")) 1060 # logger.info('%s - non-ascii file uploaded: %s' % 1061 # (ob_class, target)) 1062 # return 1062 1063 1063 1064 open(target, 'wb').write(filecontent)
Note: See TracChangeset for help on using the changeset viewer.