Fix ban screen
This commit is contained in:
@@ -59,9 +59,15 @@ async def login(request: Request, data: UserLogin, db: DbSession):
|
||||
|
||||
# Check if user is banned
|
||||
if user.is_banned:
|
||||
# Return full ban info like in deps.py
|
||||
ban_info = {
|
||||
"banned_at": user.banned_at.isoformat() if user.banned_at else None,
|
||||
"banned_until": user.banned_until.isoformat() if user.banned_until else None,
|
||||
"reason": user.ban_reason,
|
||||
}
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Your account has been banned",
|
||||
detail=ban_info,
|
||||
)
|
||||
|
||||
# If admin with Telegram linked, require 2FA
|
||||
|
||||
Reference in New Issue
Block a user