From 4ca92a11b2e44631f380041a27818523481df493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:14:36 +0000 Subject: [PATCH] remove ugly kwargs versions --- api/kiwi_vpn_api/db/device.py | 16 ---------------- api/kiwi_vpn_api/db/user.py | 13 ------------- 2 files changed, 29 deletions(-) diff --git a/api/kiwi_vpn_api/db/device.py b/api/kiwi_vpn_api/db/device.py index 7dde1b4..bb4cfe8 100644 --- a/api/kiwi_vpn_api/db/device.py +++ b/api/kiwi_vpn_api/db/device.py @@ -85,22 +85,6 @@ class Device(DeviceBase, table=True): # device already existed return None - @classmethod - def create_kwargs( - cls, - *, - owner: User, - **kwargs - ) -> Device | None: - """ - Create a new device in the database. Keywords version. - """ - - return cls.create( - owner=owner, - device=DeviceCreate(**kwargs), - ) - def update(self) -> None: """ Update this device in the database. diff --git a/api/kiwi_vpn_api/db/user.py b/api/kiwi_vpn_api/db/user.py index 4b1f3fe..33153e4 100644 --- a/api/kiwi_vpn_api/db/user.py +++ b/api/kiwi_vpn_api/db/user.py @@ -113,19 +113,6 @@ class User(UserBase, table=True): # user already existed return None - @classmethod - def create_kwargs( - cls, - **kwargs - ) -> User | None: - """ - Create a new user in the database. Keywords version. - """ - - return cls.create( - user=UserCreate(**kwargs), - ) - @classmethod def get(cls, name: str) -> User | None: """