This commit is contained in:
@@ -987,11 +987,11 @@ def create_author(**kwargs) -> Author:
|
||||
"""
|
||||
author = Author()
|
||||
# Use setattr to avoid MyPy complaints about Column assignment
|
||||
author.id = kwargs.get("user_id") # type: ignore[assignment] # Связь с user_id из системы авторизации # type: ignore[assignment]
|
||||
author.slug = kwargs.get("slug") # type: ignore[assignment] # Идентификатор из системы авторизации # type: ignore[assignment]
|
||||
author.created_at = int(time.time()) # type: ignore[assignment]
|
||||
author.updated_at = int(time.time()) # type: ignore[assignment]
|
||||
author.name = kwargs.get("name") or kwargs.get("slug") # type: ignore[assignment] # если не указано # type: ignore[assignment]
|
||||
author.id = kwargs.get("user_id") # Связь с user_id из системы авторизации
|
||||
author.slug = kwargs.get("slug") # Идентификатор из системы авторизации
|
||||
author.created_at = int(time.time())
|
||||
author.updated_at = int(time.time())
|
||||
author.name = kwargs.get("name") or kwargs.get("slug") # если не указано
|
||||
|
||||
with local_session() as session:
|
||||
session.add(author)
|
||||
|
||||
Reference in New Issue
Block a user