fix: explicitly import Site in manager_account to resolve relationship
SQLAlchemy couldn't resolve the string 'Site' in ManagerAccount's relationship() at query time because Site wasn't guaranteed to be imported first. Adding the explicit import ensures the mapper is configured correctly regardless of import order. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ from sqlalchemy import Column, Integer, String, DateTime, Table, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
from database import Base
|
||||
from models.site import Site # noqa: F401 — needed so SQLAlchemy resolves "Site" in relationship
|
||||
|
||||
|
||||
# Many-to-many: one manager can access multiple sites, one site can have multiple managers
|
||||
|
||||
Reference in New Issue
Block a user