Optional cross-approval; add long-lost git diff link

This commit is contained in:
Andrew Grant committed 2020-12-15 14:20:07 -05:00
1 parent 98180c0556
commit a59a797a9f
4 files changed
+19 -3

No files matched your search

+6
View File
@@ -420,6 +420,7 @@ def newTest(request):
return index(request, error='\n'.join(errors))
username = request.user.username
profile = Profile.objects.get(user=request.user)
LogEvent.objects.create(data="CREATE", author=username, test=test)
approved = Test.objects.filter(approved=True)
@@ -433,6 +434,11 @@ def newTest(request):
action = "AUTOAPP P={0} TP={1}".format(test.priority, test.throughput)
LogEvent.objects.create(data=action, author=username, test=test)
elif not OpenBench.config.USE_CROSS_APPROVAL and profile.approver:
test.approved = True; test.save()
action = "APPROVE P={0} TP={1}".format(test.priority, test.throughput)
LogEvent.objects.create(data=action, author=username, test=test)
return django.http.HttpResponseRedirect('/index/')