From dd329826879ce50baaad5bf779095a7f446f8aeb Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 22 Dec 2023 23:01:45 -0600 Subject: [PATCH 1/3] 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) From 015cbcc758b3cb339515987b7ca5f5518d428eac Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sun, 24 Dec 2023 00:38:36 -0600 Subject: [PATCH 2/3] Set recaptcha host to google --- judge/jinja2/social.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/judge/jinja2/social.py b/judge/jinja2/social.py index 645809d..f7ea1c5 100644 --- a/judge/jinja2/social.py +++ b/judge/jinja2/social.py @@ -48,5 +48,9 @@ for name, template, url_func in SHARES: @registry.function def recaptcha_init(language=None): return get_template("snowpenguin/recaptcha/recaptcha_init.html").render( - {"explicit": False, "language": language} + { + "explicit": False, + "language": language, + "recaptcha_host": "https://google.com", + } ) From c9f1d69b475c43f23c257acf1861361674722243 Mon Sep 17 00:00:00 2001 From: Phuoc Anh Kha Le <76896393+anhkha2003@users.noreply.github.com> Date: Sun, 24 Dec 2023 00:39:48 -0600 Subject: [PATCH 3/3] Reset textarea to default size after submitting message (#99) --- templates/chat/chat_js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/chat/chat_js.html b/templates/chat/chat_js.html index 78418c5..81fe1f9 100644 --- a/templates/chat/chat_js.html +++ b/templates/chat/chat_js.html @@ -219,7 +219,6 @@ if ($("#chat-input").val().trim()) { $('#chat-input-container').height('auto'); var body = $('#chat-input').val().trim(); - // body = body.split('\n').join('\n\n'); var message = { body: body, @@ -228,6 +227,7 @@ }; $('#chat-input').val(''); + $('#chat-input').css('height', '70%'); add_message_from_template(body, message.tmp_id);