Skip to content

Commit

Permalink
fix(pronunciation): init var transaction (#369)
Browse files Browse the repository at this point in the history
* fix(pronunciation): add a missing definition for the transaction

* test(pronunciation): change a test file

* style(test): reformat a test file
  • Loading branch information
CapooL authored Oct 13, 2024
1 parent e11c9b6 commit ed612c1
Show file tree
Hide file tree
Showing 2 changed files with 419 additions and 236 deletions.
3 changes: 2 additions & 1 deletion hinghwa-dict-backend/word/pronunciation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def post(self, request, id):
pronunciation.save()
pro = f"语音(id={id})"
contributor = pronunciation.contributor
transaction = None
if result:
content = f"恭喜您,您的语音{pro}审核通过"
transaction = manage_points_in_pronunciation(contributor.id)
Expand All @@ -378,7 +379,7 @@ def post(self, request, id):
action_object=pronunciation,
title=f"【通知】语音({pronunciation.word.word})审核结果",
)
return JsonResponse(transaction, status=200)
return JsonResponse(transaction if transaction else {}, status=200)

# PN0105 更改审核结果
def put(self, request, id):
Expand Down
Loading

0 comments on commit ed612c1

Please sign in to comment.