Fix update on test count when a test is deleted

This commit is contained in:
AndyGrant committed 2018-07-21 20:26:18 -04:00
1 parent 9369ff367b
commit 6050284d49
1 file changed
+6
+6
View File
@@ -391,6 +391,12 @@ def deleteTest(request, id):
test.deleted = True
test.save()
# Reduce the test count for the test author
user = User.objects.get(username=test.author)
profile = Profile.objects.get(user=user)
profile.tests -= 1
profile.save()
# Log the test deltion
LogEvent.objects.create(
data='Deleted Test',