fix: apk upload 修改sysconf
This commit is contained in:
parent
c4e44cda26
commit
5c94f144bd
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue