mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 14:42:10 +00:00
fixed a bug in the office preview code
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user