Fix update on test count when a test is deleted
This commit is contained in:
1 parent
9369ff367b
commit
6050284d49
1 file changed
+6
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user