CQ fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Seed test data into the database for demo purposes."""
|
||||
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
@@ -96,14 +95,18 @@ def seed_database(reference_time: datetime | None = None) -> None:
|
||||
|
||||
if child_id is None:
|
||||
# Create new child
|
||||
child_id = child_repo.create(
|
||||
created_child = child_repo.create(
|
||||
name=child_data["name"],
|
||||
birth_time=child_data["birth_time"],
|
||||
birth_weight=child_data["birth_weight"],
|
||||
user_id=user_ids[0],
|
||||
)
|
||||
child_id = created_child["id"]
|
||||
print(f"✓ Created child '{child_data['name']}'")
|
||||
|
||||
# Ensure child_id is set
|
||||
assert child_id is not None, "Child ID must be set at this point"
|
||||
|
||||
# Share child with second user if not already shared
|
||||
parent_ids = child_repo.get_parent_ids(child_id)
|
||||
if user_ids[1] not in parent_ids:
|
||||
@@ -111,9 +114,6 @@ def seed_database(reference_time: datetime | None = None) -> None:
|
||||
msg = f"✓ Shared child with '{test_data['users'][1]['username']}'"
|
||||
print(msg)
|
||||
|
||||
# Ensure child_id is set
|
||||
assert child_id is not None, "Child ID must be set at this point"
|
||||
|
||||
# Clear existing logs to avoid duplicates
|
||||
print("Clearing existing logs...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user