Add flake8 docstring plugin, formatting, create base class for embeds & models

This commit is contained in:
stijndcl 2022-07-13 22:54:16 +02:00
parent 8d6dbe1c94
commit b9c5c6ab10
24 changed files with 241 additions and 16 deletions

View file

@ -28,6 +28,7 @@ async def create_new_announcement(
async def remove_old_announcements(session: AsyncSession):
"""Delete all announcements that are > 8 days old
The RSS feed only goes back 7 days, so all of these old announcements never have to
be checked again when checking if an announcement is fresh or not.
"""

View file

@ -12,7 +12,8 @@ __all__ = [
async def get_or_add(session: AsyncSession, user_id: int) -> User:
"""Get a user's profile
If it doesn't exist yet, create it (along with all linked datastructures).
If it doesn't exist yet, create it (along with all linked datastructures)
"""
statement = select(User).where(User.user_id == user_id)
user: Optional[User] = (await session.execute(statement)).scalar_one_or_none()