From 71e7d4d1879c0397c3206527a8274b7c09f9d413 Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 7 Jun 2024 17:08:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20base=20send=5Fmail=5Ftask=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8F=91=E9=80=81=E5=A4=9A=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/utils/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/utils/tasks.py b/apps/utils/tasks.py index 77b9490e..6af65d17 100644 --- a/apps/utils/tasks.py +++ b/apps/utils/tasks.py @@ -18,7 +18,7 @@ def send_mail_task(**args): settings.SYS_NAME, settings.SYS_VERSION, config['base']['base_name_short'], subject) args['from_email'] = args.get('from_email', settings.EMAIL_HOST_USER) args['recipient_list'] = args.get( - 'recipient_list', [settings.EMAIL_HOST_USER]) + 'recipient_list', settings.EMAIL_DEVELOPERS if hasattr(settings, 'EMAIL_DEVELOPERS') else [settings.EMAIL_HOST_USER]) cache_key = f'error_mail_{subject}' email_tuple = cache.get(cache_key) if email_tuple is None: From 18b042904469fba8f5539590aba8300886d7045c Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 11 Jun 2024 09:11:32 +0800 Subject: [PATCH 2/2] fix: edu/submit --- apps/edu/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/edu/views.py b/apps/edu/views.py index 87c5f830..5f6919b0 100644 --- a/apps/edu/views.py +++ b/apps/edu/views.py @@ -169,13 +169,13 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, RetrieveModelMixin, C serializer = ExamRecordSubmitSerializer(data = request.data) serializer.is_valid(raise_exception=True) vdata = serializer.validated_data - questions_ = vdata['detail_'] + detail = vdata['detail'] # 后端判卷 ads = AnswerDetail.objects.select_related('question').filter(examrecord=er).order_by('id') total_score = 0 try: for index, ad in enumerate(ads): - ad.user_answer = questions_[index]['user_answer'] + ad.user_answer = detail[index]['user_answer'] if ad.question.type == '多选': if set(ad.question.right) == set(ad.user_answer): ad.is_right = True