Merge branch 'master' of 10.7.100.160:/job/safesite
This commit is contained in:
commit
2ed88c7b33
11
Pipfile
11
Pipfile
|
@ -1,11 +0,0 @@
|
||||||
[[source]]
|
|
||||||
name = "pypi"
|
|
||||||
url = "https://pypi.org/simple"
|
|
||||||
verify_ssl = true
|
|
||||||
|
|
||||||
[dev-packages]
|
|
||||||
|
|
||||||
[packages]
|
|
||||||
|
|
||||||
[requires]
|
|
||||||
python_version = "3.5"
|
|
|
@ -268,7 +268,7 @@ def drusers(companyid,path):
|
||||||
wb = load_workbook(path)
|
wb = load_workbook(path)
|
||||||
sheet = wb.worksheets[0]
|
sheet = wb.worksheets[0]
|
||||||
partdict = {}
|
partdict = {}
|
||||||
groupdict = {}
|
# groupdict = {}
|
||||||
userdict = {}
|
userdict = {}
|
||||||
parts = Partment.objects.filter(partlink__contains=',' + companyid + ',')|Partment.objects.filter(partid=companyid) #获取所有部门
|
parts = Partment.objects.filter(partlink__contains=',' + companyid + ',')|Partment.objects.filter(partid=companyid) #获取所有部门
|
||||||
for i in parts:
|
for i in parts:
|
||||||
|
|
|
@ -2215,11 +2215,10 @@ def parthandle(req):
|
||||||
return HttpResponse(json.dumps(b,cls=MyEncoder),content_type="application/json")
|
return HttpResponse(json.dumps(b,cls=MyEncoder),content_type="application/json")
|
||||||
elif req.GET.get('a')=='del':
|
elif req.GET.get('a')=='del':
|
||||||
a = req.POST.get('partid')
|
a = req.POST.get('partid')
|
||||||
if Partment.objects.filter(partlink__contains=','+a+',') or User.objects.filter(ubelongpart=a):
|
if Partment.objects.filter(partlink__contains=','+a+',').exists() or User.objects.filter(ubelongpart=a).exists():
|
||||||
return JsonResponse({"code":0})
|
return JsonResponse({"code":0})
|
||||||
else:
|
else:
|
||||||
a = Partment.objects.get(partid=a)
|
Partment.objects.get(partid=a).delete()
|
||||||
a.delete()
|
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
elif req.GET.get('a')=='addpart':
|
elif req.GET.get('a')=='addpart':
|
||||||
if req.POST.get('partid') != '':
|
if req.POST.get('partid') != '':
|
||||||
|
@ -4724,7 +4723,8 @@ def apiquestion(req):
|
||||||
elif a == 'exercise':
|
elif a == 'exercise':
|
||||||
data = json.loads(req.body.decode('utf-8'))
|
data = json.loads(req.body.decode('utf-8'))
|
||||||
x = Question.objects.filter(deletemark=1)
|
x = Question.objects.filter(deletemark=1)
|
||||||
a = (x.filter(usecomps__contains=',1,')|x.filter(usecomps__contains=','+companyid+',')).exclude(nousecomps__contains=','+companyid+',')
|
#a = (x.filter(usecomps__contains=',1,')|x.filter(usecomps__contains=','+companyid+',')).exclude(nousecomps__contains=','+companyid+',')
|
||||||
|
a = x.exclude(nousecomps__contains=','+companyid+',')
|
||||||
tmlxs = data['tmlx']
|
tmlxs = data['tmlx']
|
||||||
ydtms = data['ydtms']
|
ydtms = data['ydtms']
|
||||||
a = x.filter(questioncat__id__in=tmlxs).exclude(id__in=ydtms)
|
a = x.filter(questioncat__id__in=tmlxs).exclude(id__in=ydtms)
|
||||||
|
|
Loading…
Reference in New Issue