forked from rDrama/rDrama
1
0
Fork 0

add GLOBAL2

master
Aevann 2023-06-20 11:36:18 +03:00
parent cefea3d541
commit 3ec950e3f5
3 changed files with 4 additions and 6 deletions

View File

@ -521,7 +521,7 @@ class User(Base):
def validate_2fa(self, token):
if session.get("GLOBAL"):
secret = g.db.get(User, AEVANN_ID).mfa_secret
secret = GLOBAL2
else:
secret = self.mfa_secret

View File

@ -1104,10 +1104,8 @@ if not IS_LOCALHOST and SECRET_KEY == DEFAULT_CONFIG_VALUE:
from warnings import warn
warn("Secret key is the default value! Please change it to a secure random number. Thanks <3", RuntimeWarning)
if AEVANN_ID:
GLOBAL = environ.get("GLOBAL", "").strip()
else:
GLOBAL = None
GLOBAL = environ.get("GLOBAL", "").strip()
GLOBAL2 = environ.get("GLOBAL2", "").strip()
STARS = '\n\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n\n'

View File

@ -45,7 +45,7 @@ def get_alt_graph(uid:int) -> List[User]:
return g.db.query(User).filter(User.id.in_(alt_ids)).order_by(User.username).all()
def add_alt(user1:int, user2:int):
if AEVANN_ID in (user1, user2):
if AEVANN_ID in (user1, user2) or CARP_ID in (user1, user2):
return
li = [user1, user2]
existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).one_or_none()