chenjunkai 5 жил өмнө
parent
commit
ce162225f8
1 өөрчлөгдсөн 18 нэмэгдсэн , 17 устгасан
  1. 18 17
      Controller/AppInfo.py

+ 18 - 17
Controller/AppInfo.py

@@ -196,25 +196,26 @@ class AppInfo(View):
         minAppversion = request_dict.get('minAppversion', None)
         downloadLink = request_dict.get('downloadLink', None)
         f = self.request.FILES.get('file', None)
-        if not all(
-                [appBundleId, appName, systemLanguage, newAppversion, content, app_type, bundleVersion]):
-            return response.json(444)
         try:
-
             app_info = App_Info.objects.get(id=id)
-            app_info.appBundleId = appBundleId
-            app_info.appName = appName
-            app_info.systemLanguage = systemLanguage
-            app_info.newAppversion = newAppversion
-            app_info.content = content
-            app_info.app_type = app_type
-            app_info.minAppversion = minAppversion
-            app_info.bundleVersion = bundleVersion
-            app_info.downloadLink = downloadLink
-            print('ffff')
-            print(f)
-            print('ffff')
-
+            if appBundleId:
+                app_info.appBundleId = appBundleId
+            if appName:
+                app_info.appName = appName
+            if systemLanguage:
+                app_info.systemLanguage = systemLanguage
+            if newAppversion:
+                app_info.newAppversion = newAppversion
+            if content:
+                app_info.content = content
+            if app_type:
+                app_info.app_type = app_type
+            if minAppversion:
+                app_info.minAppversion = minAppversion
+            if bundleVersion:
+                app_info.bundleVersion = bundleVersion
+            if downloadLink:
+                app_info.downloadLink = downloadLink
             if f:
                 try:
                     rv_path = 'static/app/image/' + appBundleId + '.png'