Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/app/api/controllers/search_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self) -> None:

def _serialize_datetime(self, obj: Any) -> Any:
"""Recursively serialize datetime objects to ISO format strings"""
if isinstance(obj, (str, int, float, bool, type(None))):
if isinstance(obj, str | int | float | bool) or obj is None:
return obj
elif hasattr(obj, "isoformat"): # datetime objects
return obj.isoformat()
Expand Down
8 changes: 6 additions & 2 deletions backend/app/services/dropbox_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ def process_matches(matches):
dbx_ns.files_search_v2, search_arg
)

# Capture loop variables to avoid B023 error
namespace_id = ns.namespace_id
namespace_name = ns.name

def process_ns_matches(matches):
for match in matches:
if hasattr(match, "metadata") and hasattr(
Expand All @@ -757,8 +761,8 @@ def process_ns_matches(matches):
"path_display": entry.path_display,
".tag": "file" if is_file else "folder",
"namespace_type": "team",
"namespace_id": ns.namespace_id,
"namespace_name": ns.name,
"namespace_id": namespace_id,
"namespace_name": namespace_name,
}

if is_file:
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/api/routes/test_dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def test_user(db: Session) -> User:
"""Create a test user."""
user = User(
email="dropbox_test@example.com",
email=f"dropbox_test_{uuid.uuid4()}@example.com",
hashed_password="hashed",
first_name="Test",
last_name="User",
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/api/routes/test_one_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def test_user(db: Session) -> User:
"""Create a test user."""
user = User(
email="onedrive_test@example.com",
email=f"onedrive_test_{uuid.uuid4()}@example.com",
hashed_password="hashed",
first_name="Test",
last_name="User",
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/unit/test_external_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_external_account_model_creation(db: Session):
"""Test ExternalAccount model creation to ensure TYPE_CHECKING import is exercised."""
# Create a user first
user = User(
email="test@example.com",
email=f"test_external_account_{uuid.uuid4()}@example.com",
hashed_password="hashed",
first_name="Test",
last_name="User",
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/unit/test_one_drive_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def service():
def test_user(db: Session) -> User:
"""Create a test user."""
user = User(
email="test@example.com",
email=f"test_onedrive_service_{uuid.uuid4()}@example.com",
hashed_password="hashed",
first_name="Test",
last_name="User",
Expand Down
Loading