mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-30 04:25:47 +00:00
fixed a bug in the office preview code
This commit is contained in:
parent
baa74e0185
commit
fd9adcd3a3
@ -294,7 +294,7 @@ def view_file(request, repo_id):
|
||||
filesizeformat(FILE_PREVIEW_MAX_SIZE)
|
||||
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.') % \
|
||||
filesizeformat(OFFICE_PREVIEW_MAX_SIZE)
|
||||
ret_dict['err'] = err
|
||||
@ -465,7 +465,7 @@ def view_history_file_common(request, repo_id, ret_dict):
|
||||
filesizeformat(FILE_PREVIEW_MAX_SIZE)
|
||||
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.') % \
|
||||
filesizeformat(OFFICE_PREVIEW_MAX_SIZE)
|
||||
ret_dict['err'] = err
|
||||
@ -767,4 +767,4 @@ def office_convert_query_page_num(request):
|
||||
logging.exception('failed to call query_office_file_pages');
|
||||
ret['error'] = str(e)
|
||||
|
||||
return HttpResponse(json.dumps(ret), content_type=content_type)
|
||||
return HttpResponse(json.dumps(ret), content_type=content_type)
|
||||
|
Loading…
Reference in New Issue
Block a user