Przeglądaj źródła

测报灯图片收集

yf_ymm 5 lat temu
rodzic
commit
cfa8e670a2
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      apps/Equipment/views.py

+ 5 - 1
apps/Equipment/views.py

@@ -4638,5 +4638,9 @@ class System_Photo_Save(ListView):
     def post(self,request):
         pic_1 = request.POST.get('pic_1')
         pic_2 = request.POST.get('pic_2')
-        SystemPhoto.objects.create(pic_1=pic_1,pic_2=pic_2)
+        if pic_1:
+            name = pic_1
+        elif pic2:
+            name = pic_2
+        SystemPhoto.objects.create(name=name,pic_1=pic_1,pic_2=pic_2)
         return HttpResponse("1")