From 5c94f144bdb9e22c6d3559f2f2b5a4d5643f22bf Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 8 Jun 2023 09:14:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20apk=20upload=20=E4=BF=AE=E6=94=B9sysconf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/system/views.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/system/views.py b/apps/system/views.py index ac40d750..7dc89a45 100755 --- a/apps/system/views.py +++ b/apps/system/views.py @@ -633,11 +633,6 @@ class FileViewSet(CustomCreateModelMixin, RetrieveModelMixin, ListModelMixin, Cu instance.save() -# 生成ConfigParser对象 -config = configparser.ConfigParser() -# 读取配置文件 -filename = os.path.join(settings.BASE_DIR, 'server/conf.ini') - class ApkViewSet(MyLoggingMixin, ListModelMixin, CreateModelMixin, GenericViewSet): perms_map = {'get': '*', 'post': 'apk.upload'} serializer_class = ApkSerializer @@ -671,6 +666,7 @@ class ApkViewSet(MyLoggingMixin, ListModelMixin, CreateModelMixin, GenericViewSe vdata = sr.validated_data from shutil import copyfile copyfile(settings.BASE_DIR + vdata['file'], settings.BASE_DIR + '/media/zc_ehs.apk') + global SYSCONF SYSCONF['apk']['apk_version'] = vdata['version'] SYSCONF['apk']['apk_file'] = vdata['file'] SysConfigView.save_sysconf()