diff --git a/hinghwa-dict-backend/word/pronunciation/urls.py b/hinghwa-dict-backend/word/pronunciation/urls.py index f04fae38..86c19b8c 100644 --- a/hinghwa-dict-backend/word/pronunciation/urls.py +++ b/hinghwa-dict-backend/word/pronunciation/urls.py @@ -16,7 +16,7 @@ path("/combine", combinePronunciationV2), path("/translate", translatePronunciation), path("//visibility", csrf_exempt(ManageApproval.put)), # PUT PN0105 修改审核结果 - path("//examine", csrf_exempt(ManageApproval.post)), # POST PN0106 审核 + path("//examine", csrf_exempt(ManageApproval.as_view())), # POST PN0106 审核 path("/ranking", csrf_exempt(PronunciationRanking.as_view())), # PN0205语音榜单 path("/", combinePronunciation), ] diff --git a/hinghwa-dict-backend/word/pronunciation/views.py b/hinghwa-dict-backend/word/pronunciation/views.py index 9f7e30dd..1ad7bc94 100644 --- a/hinghwa-dict-backend/word/pronunciation/views.py +++ b/hinghwa-dict-backend/word/pronunciation/views.py @@ -13,7 +13,7 @@ from django.db.models import Q, Count, Max from django.core.paginator import Paginator from pydub import AudioSegment as audio - +from rewards.transactions.dto import transactions_all from user.models import User from utils.token import get_request_user, token_pass, token_user from user.dto.user_simple import user_simple @@ -40,6 +40,7 @@ manage_points_in_pronunciation, revert_points_in_pronunciation, ) +from rewards.transactions.dto import transactions_all # 从id中获取单条语音 @@ -367,11 +368,9 @@ def post(self, request, id): contributor = pronunciation.contributor if result: content = f"恭喜您,您的语音{pro}审核通过" - transaction_info = manage_points_in_pronunciation(contributor.id) - + transaction = manage_points_in_pronunciation(contributor.id) else: content = f"很遗憾,您的语音{pro}审核未通过" - transaction_info = revert_points_in_pronunciation(contributor.id) sendNotification( verifier, [contributor], @@ -379,7 +378,7 @@ def post(self, request, id): action_object=pronunciation, title=f"【通知】语音({pronunciation.word.word})审核结果", ) - return JsonResponse(transaction_info, status=200) + return JsonResponse(transaction, status=200) # PN0105 更改审核结果 def put(self, request, id):