From dc2578177bbd26d8abb75c4299e2d1e8ac32d5a6 Mon Sep 17 00:00:00 2001 From: yangjian Date: Mon, 6 Apr 2020 18:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E8=AE=A1=E7=AE=97=E5=87=BD=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_doc/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app_doc/views.py b/app_doc/views.py index e296044..18c015c 100644 --- a/app_doc/views.py +++ b/app_doc/views.py @@ -1174,8 +1174,9 @@ def manage_attachment(request): for i in formats: size /= unit if size < unit: - return f'{round(size, precision)}{i}' - return f'{round(size, precision)}{i}' + r = '{}{}'.format(round(size, precision),i) + return r + if request.method == 'GET': try: search_kw = request.GET.get('kw', None)