Skip to content

Commit 471aed6

Browse files
committed
remove old user
1 parent a97c63b commit 471aed6

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apk update && apk add --no-cache libressl jpeg-dev openjpeg-dev libimagequan
1313

1414
FROM alpine AS nodebuilder
1515
RUN apk add curl jq
16-
RUN wget $(curl -s https://api.github.com/repos/tgbot-collection/YYeTsFE/releases/tags/ads-2026-05-05 | jq -r '.assets[] | select(.name == "build.zip") | .browser_download_url')
16+
RUN wget $(curl -s https://api.github.com/repos/tgbot-collection/YYeTsFE/releases/tags/ads-2026-05-05-new | jq -r '.assets[] | select(.name == "build.zip") | .browser_download_url')
1717
RUN unzip build.zip && rm build.zip
1818

1919
FROM runner

yyetsweb/databases/base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ def is_user_blocked(self, username: str) -> str:
2525
if r:
2626
return r["status"]["reason"]
2727

28-
def is_old_user(self, username: str) -> bool:
29-
return bool(self.db["users"].find_one({"username": username, "oldUser": True}))
30-
3128

3229
class Redis:
3330
def __init__(self):

yyetsweb/databases/comment.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
# coding: utf-8
33
import contextlib
4+
import logging
45
import os
56
import re
67
from http import HTTPStatus
@@ -130,7 +131,10 @@ def add_comment(
130131
) -> dict:
131132
user_data = self.db["users"].find_one({"username": username})
132133
# old user is allowed to comment without verification
133-
if not self.is_old_user(username) and user_data.get("email", {}).get("verified", False) is False:
134+
# admin can comment
135+
if "admin" in user_data.get("group") or user_data.get("email", {}).get("verified") is True:
136+
logging.info("%s is allowed to leave comment", username)
137+
else:
134138
return {
135139
"status_code": HTTPStatus.TEMPORARY_REDIRECT,
136140
"message": "你需要验证邮箱才能评论,请到个人中心进行验证",

yyetsweb/databases/oauth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def add_user(self, username, ip, browser, uid, source: "str"):
3030
"source": source,
3131
"uid": uid,
3232
"hash": sha256(username.encode("u8")).hexdigest(),
33+
"email": {"verified": True, "address": username},
3334
}
3435
)
3536
return {

0 commit comments

Comments
 (0)