lint: replace no-op flake8 script with gating ruff check, fix findings
CI / skip-ci-check (push) Successful in 18s
CI / python-lint (push) Failing after 19s
CI / docker-ci (push) Successful in 21s
CI / secret-scan (push) Successful in 30s
CI / skip-ci-check (pull_request) Successful in 27s
CI / python-lint (pull_request) Failing after 21s
CI / docker-ci (pull_request) Successful in 22s
CI / admin-unit (push) Successful in 44s
CI / secret-scan (pull_request) Successful in 45s
CI / admin-unit (pull_request) Successful in 55s
CI / viewer-unit (push) Successful in 1m54s
CI / viewer-unit (pull_request) Successful in 1m45s
CI / e2e (push) Failing after 6m5s
CI / e2e (pull_request) Successful in 6m43s

This commit is contained in:
2026-07-26 16:01:28 -04:00
parent abb7b34700
commit fc3960afa9
32 changed files with 218 additions and 218 deletions
+5 -5
View File
@@ -17,18 +17,18 @@ from backend.constants.roles import (
DEFAULT_USER_ROLE,
ROLE_VALUES,
)
from backend.db.session import get_db
from backend.db.models import User
from backend.utils.password import verify_password, hash_password
from backend.db.session import get_db
from backend.schemas.auth import (
LoginRequest,
PasswordChangeRequest,
PasswordChangeResponse,
RefreshRequest,
TokenResponse,
UserResponse,
PasswordChangeRequest,
PasswordChangeResponse,
)
from backend.services.role_permissions import fetch_role_permissions_map
from backend.utils.password import hash_password, verify_password
router = APIRouter(prefix="/auth", tags=["auth"])
@@ -315,7 +315,7 @@ def get_current_user_info(
# If user doesn't exist in main database, check if we should bootstrap them
if not user:
# Check if any admin users exist
admin_count = db.query(User).filter(User.is_admin == True).count()
admin_count = db.query(User).filter(User.is_admin.is_(True)).count()
# If no admins exist, bootstrap current user as admin
if admin_count == 0: