Skip to content

Commit

Permalink
fix(words): fix the wrong name of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
CapooL committed Dec 6, 2023
1 parent dd2a914 commit 859a7a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hinghwa-dict-backend/word/pronunciation/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
path("/combine", combinePronunciationV2),
path("/translate", translatePronunciation),
path("/<int:id>/visibility", csrf_exempt(ManageApproval.put)), # PUT PN0105 修改审核结果
path("/<int:id>/examine", csrf_exempt(ManageApproval.post)), # POST PN0106 审核
path("/<int:id>/examine", csrf_exempt(ManageApproval.as_view())), # POST PN0106 审核
path("/ranking", csrf_exempt(PronunciationRanking.as_view())), # PN0205语音榜单
path("/<str:ipa>", combinePronunciation),
]
9 changes: 4 additions & 5 deletions hinghwa-dict-backend/word/pronunciation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,6 +40,7 @@
manage_points_in_pronunciation,
revert_points_in_pronunciation,
)
from rewards.transactions.dto import transactions_all


# 从id中获取单条语音
Expand Down Expand Up @@ -367,19 +368,17 @@ 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],
content=content + reason,
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):
Expand Down

0 comments on commit 859a7a4

Please sign in to comment.