Skip to content

Commit

Permalink
cookie: fix table
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 8, 2024
1 parent ab62713 commit 926a951
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions linkedin_matrix/db/cookie.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
from __future__ import annotations

from typing import cast

from asyncpg import Record
from attr import dataclass

from linkedin_messaging import URN
from mautrix.types import RoomID, UserID
from mautrix.types import UserID

from .model_base import Model


@dataclass
class Cookie(Model):
mxid: UserID
name: string
value: string
name: str
value: str

_table_name = "cookie"
_field_list = [
Expand All @@ -38,7 +35,7 @@ async def get_for_mxid(cls, mxid: id.UserID) -> list[Cookie]:

@classmethod
async def delete_all_for_mxid(cls, mxid: id.UserID):
await self.db.execute("DELETE FROM cookie WHERE mxid=$1", self.mxid)
await cls.db.execute("DELETE FROM cookie WHERE mxid=$1", mxid)

@classmethod
async def bulk_upsert(cls, mxid: id.UserID, cookies: dict[str, str]):
Expand Down

0 comments on commit 926a951

Please sign in to comment.