1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-30 13:23:14 +00:00

fixed a bug in the office preview code

This commit is contained in:
lins05 2013-06-10 13:32:16 +08:00
parent baa74e0185
commit fd9adcd3a3

View File

@ -294,7 +294,7 @@ def view_file(request, repo_id):
filesizeformat(FILE_PREVIEW_MAX_SIZE) filesizeformat(FILE_PREVIEW_MAX_SIZE)
ret_dict['err'] = err ret_dict['err'] = err
elif filetype in (DOCUMENT, PDF) and fsize > OFFICE_PREVIEW_MAX_SIZE: elif filetype in (DOCUMENT, PDF) and HAS_OFFICE_CONVERTER and fsize > OFFICE_PREVIEW_MAX_SIZE:
err = _(u'File size surpasses %s, can not be opened online.') % \ err = _(u'File size surpasses %s, can not be opened online.') % \
filesizeformat(OFFICE_PREVIEW_MAX_SIZE) filesizeformat(OFFICE_PREVIEW_MAX_SIZE)
ret_dict['err'] = err ret_dict['err'] = err
@ -465,7 +465,7 @@ def view_history_file_common(request, repo_id, ret_dict):
filesizeformat(FILE_PREVIEW_MAX_SIZE) filesizeformat(FILE_PREVIEW_MAX_SIZE)
ret_dict['err'] = err ret_dict['err'] = err
elif filetype in (DOCUMENT, PDF) and fsize > OFFICE_PREVIEW_MAX_SIZE: elif filetype in (DOCUMENT, PDF) and HAS_OFFICE_CONVERTER and fsize > OFFICE_PREVIEW_MAX_SIZE:
err = _(u'File size surpasses %s, can not be opened online.') % \ err = _(u'File size surpasses %s, can not be opened online.') % \
filesizeformat(OFFICE_PREVIEW_MAX_SIZE) filesizeformat(OFFICE_PREVIEW_MAX_SIZE)
ret_dict['err'] = err ret_dict['err'] = err
@ -767,4 +767,4 @@ def office_convert_query_page_num(request):
logging.exception('failed to call query_office_file_pages'); logging.exception('failed to call query_office_file_pages');
ret['error'] = str(e) ret['error'] = str(e)
return HttpResponse(json.dumps(ret), content_type=content_type) return HttpResponse(json.dumps(ret), content_type=content_type)