Skip to content

Commit

Permalink
style: delete useless token = token_pass()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahe-YiXing committed Nov 30, 2024
1 parent 5027c31 commit 3eeebd4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions hinghwa-dict-backend/article/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def put(self, request, id) -> JsonResponse:
if not article.exists():
raise ArticleNotFoundException()
article = article[0]
token = token_pass(request.headers, article.author.id)
body = demjson3.decode(request.body)
body = body["article"]
article_form = ArticleForm(body)
Expand Down Expand Up @@ -189,15 +188,13 @@ def delete(self, request, id) -> JsonResponse:
if not article.exists():
raise ArticleNotFoundException()
article = article[0]
token = token_pass(request.headers, article.author.id)
article.delete()
return JsonResponse({}, status=200)


class ManageVisibility(View):
# AT0105 文章审核
def put(self, request, id) -> JsonResponse:
token = token_pass(request.headers, -1)
article = Article.objects.filter(id=id)
if not article.exists():
raise ArticleNotFoundException()
Expand Down
1 change: 0 additions & 1 deletion hinghwa-dict-backend/music/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def delete(self, request, id) -> JsonResponse:
class VisibilityMusic(View):
# MC0105 设置音乐可见性
def put(self, request, id) -> JsonResponse:
token = token_pass(request.headers, -1)
music = Music.objects.filter(id=id)
if not music.exists():
raise MusicNotFoundException()
Expand Down
1 change: 0 additions & 1 deletion hinghwa-dict-backend/quiz/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def get(self, request) -> JsonResponse:
class ManageVisibility(View):
# QZ0105 问题审核
def put(self, request, id) -> JsonResponse:
token = token_pass(request.headers, -1)
quiz = Quiz.objects.filter(id=id)
if not quiz.exists():
raise QuizNotFoundException()
Expand Down

0 comments on commit 3eeebd4

Please sign in to comment.