From dd329826879ce50baaad5bf779095a7f446f8aeb Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 22 Dec 2023 23:01:45 -0600 Subject: [PATCH] Remove transaction in comment --- judge/views/comment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/judge/views/comment.py b/judge/views/comment.py index af00190..b4808a7 100644 --- a/judge/views/comment.py +++ b/judge/views/comment.py @@ -4,7 +4,7 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.contrib.auth.context_processors import PermWrapper from django.core.exceptions import PermissionDenied -from django.db import IntegrityError, transaction +from django.db import IntegrityError from django.db.models import Q, F, Count, FilteredRelation from django.db.models.functions import Coalesce from django.db.models.expressions import F, Value @@ -242,7 +242,7 @@ class CommentEditAjax(LoginRequiredMixin, CommentMixin, UpdateView): add_mention_notifications(comment) comment.revision_count = comment.versions.count() + 1 comment.save(update_fields=["revision_count"]) - with transaction.atomic(), revisions.create_revision(): + with revisions.create_revision(): revisions.set_comment(_("Edited from site")) revisions.set_user(self.request.user) return super(CommentEditAjax, self).form_valid(form)