Browse Source

数据库调整

yf_ymm 5 năm trước cách đây
mục cha
commit
ace4e01dc3
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      apps/Equipment/views.py

+ 4 - 1
apps/Equipment/views.py

@@ -1121,7 +1121,10 @@ class Farm_Choice(ListView):
         username = request.user.username
         print('username:',username)
         current_user = MyUser.objects.get(username=username)
-        farmlist = FarmList.objects.filter(user=current_user)
+        if current_user.is_staff == True:
+            farmlist = FarmList.objects.all()
+        else:
+            farmlist = FarmList.objects.filter(user=current_user)
         dat = []
         for i in farmlist:
             dat.append({"name":i.name})