Skip to content

Commit

Permalink
refactor: format notification content (#328)
Browse files Browse the repository at this point in the history
* refactor(word): format notification content

* refactor(article): format notification content
  • Loading branch information
sheeplin authored Sep 16, 2023
1 parent 7b5d470 commit 9575dbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions hinghwa-dict-backend/article/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ def put(self, request, id) -> JsonResponse:
body = demjson.decode(request.body)
article.visibility = body["result"]
if article.visibility:
content = f"恭喜您的文章(id ={id}) 已通过审核"
content = f"恭喜您的 文章(id={id}) 已通过审核"
user_id = article.author.id
transaction_info = manage_points_in_article(user_id)
else:
msg = body["reason"]
content = f"您的文章(id = {id}) 审核状态变为不可见,理由是:\n\t{msg}"
content = f"您的 文章(id={id}) 审核状态变为不可见,理由是:\n\t{msg}"
sendNotification(
None,
[article.author],
Expand Down
10 changes: 5 additions & 5 deletions hinghwa-dict-backend/word/application/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def put(self, request, id) -> JsonResponse:
# 修改词语
word = application.word
content = (
f"您对(id = {application.word.id}) 词语提出的修改建议(id = {application.id})已通过"
f"您对 词语(id={application.word.id}) 提出的修改建议申请(id={application.id}) 已通过"
f",感谢您为社区所做的贡献!"
)
title = "【通知】词条修改申请审核结果"
Expand All @@ -131,8 +131,8 @@ def put(self, request, id) -> JsonResponse:
)
application.word = word
content = (
f"您的创建申请 (id = {application.id})已通过,"
f"已创建词条(id = {word.id}),感谢您为社区所做的贡献!"
f"您的创建 申请(id={application.id}) 已通过,"
f"已创建 词条(id={word.id}) ,感谢您为社区所做的贡献!"
)
title = "【通知】词条创建申请审核结果"
attributes = [
Expand Down Expand Up @@ -160,14 +160,14 @@ def put(self, request, id) -> JsonResponse:
if application.word:
# 修改词语
content = (
f"您对(id = {application.word.id}) 词语提出的修改建议(id = {application.id})"
f"您对 词语(id={application.word.id}) 提出的修改建议 申请(id={application.id})"
f'未能通过审核,理由是:\n\t{body["reason"]}\n感谢您为社区所做的贡献!'
)
feedback = application.word.id
else:
# 新建词语
content = (
f"您的创建申请 (id = {application.id})未能通过审核,"
f"您的词语创建 申请(id={application.id}) 未能通过审核,"
f'理由是:\n\t{body["reason"]}\n感谢您为社区所做的贡献!'
)
application.save()
Expand Down

0 comments on commit 9575dbb

Please sign in to comment.