mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Add flake8 docstring plugin, formatting, create base class for embeds & models
This commit is contained in:
parent
8d6dbe1c94
commit
b9c5c6ab10
24 changed files with 241 additions and 16 deletions
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue