chore(quality): apply ruff autofixes and formatting (223 fixes, regression-free: 118/118 tests pass)

This commit is contained in:
Agent Zero
2026-06-10 21:24:24 +00:00
committed by leocrm-bot
parent 7104335334
commit b5f7a220fe
56 changed files with 459 additions and 528 deletions
+3 -9
View File
@@ -27,19 +27,13 @@ class Note(Base, TimestampMixin, SoftDeleteMixin, OrgScopedMixin):
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
body: Mapped[str] = mapped_column(Text, nullable=False)
author_id: Mapped[int] = mapped_column(
ForeignKey("users.id"), nullable=False, index=True
)
parent_type: Mapped[NoteParentType] = mapped_column(
String(32), nullable=False, index=True
)
author_id: Mapped[int] = mapped_column(ForeignKey("users.id"), nullable=False, index=True)
parent_type: Mapped[NoteParentType] = mapped_column(String(32), nullable=False, index=True)
# parent_id is intentionally NOT a DB FK because of polymorphic parent.
# Service layer (note_service.create_note) validates existence.
parent_id: Mapped[int] = mapped_column(Integer, nullable=False, index=True)
author: Mapped["User"] = relationship(
"User", foreign_keys=[author_id], lazy="joined"
)
author: Mapped[User] = relationship("User", foreign_keys=[author_id], lazy="joined")
def __repr__(self) -> str:
return f"<Note id={self.id} parent={self.parent_type}:{self.parent_id}>"