##// END OF EJS Templates
Fixed attachment extension
neko259 -
r1370:cc49db45 default
parent child Browse files
Show More
@@ -128,8 +128,8 b' def validate_file_size(size: int):'
128
128
129 def get_upload_filename(model_instance, old_filename):
129 def get_upload_filename(model_instance, old_filename):
130 # TODO Use something other than random number in file name
130 # TODO Use something other than random number in file name
131 if hasattr(model_instance, 'file_type'):
131 if hasattr(model_instance, 'mimetype'):
132 extension = model_instance.file_type
132 extension = model_instance.mimetype
133 else:
133 else:
134 extension = old_filename.split(FILE_EXTENSION_DELIMITER)[-1:][0]
134 extension = old_filename.split(FILE_EXTENSION_DELIMITER)[-1:][0]
135 new_name = '{}{}.{}'.format(
135 new_name = '{}{}.{}'.format(
General Comments 0
You need to be logged in to leave comments. Login now