From 23e4d9daff157d18442374fdd52bc8acbc1cb81c Mon Sep 17 00:00:00 2001 From: Jonathan Rohde Date: Tue, 25 Jun 2024 08:35:55 +0200 Subject: [PATCH] feat(sqlalchemy): formatting --- backend/apps/webui/models/auths.py | 3 ++- backend/migrations/versions/7e5b5dc7342b_init.py | 2 +- backend/test/apps/webui/routers/test_models.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/apps/webui/models/auths.py b/backend/apps/webui/models/auths.py index aef895619..560d9a686 100644 --- a/backend/apps/webui/models/auths.py +++ b/backend/apps/webui/models/auths.py @@ -113,7 +113,8 @@ class AuthsTable: Session.add(result) user = Users.insert_new_user( - id, name, email, profile_image_url, role, oauth_sub) + id, name, email, profile_image_url, role, oauth_sub + ) Session.commit() Session.refresh(result) diff --git a/backend/migrations/versions/7e5b5dc7342b_init.py b/backend/migrations/versions/7e5b5dc7342b_init.py index 8f197ce5b..90597ec9b 100644 --- a/backend/migrations/versions/7e5b5dc7342b_init.py +++ b/backend/migrations/versions/7e5b5dc7342b_init.py @@ -176,7 +176,7 @@ def upgrade() -> None: sa.Column("api_key", sa.String(), nullable=True), sa.Column("settings", apps.webui.internal.db.JSONField(), nullable=True), sa.Column("info", apps.webui.internal.db.JSONField(), nullable=True), - sa.Column('oauth_sub', sa.Text(), nullable=True), + sa.Column("oauth_sub", sa.Text(), nullable=True), sa.PrimaryKeyConstraint("id"), sa.UniqueConstraint("api_key"), sa.UniqueConstraint("oauth_sub"), diff --git a/backend/test/apps/webui/routers/test_models.py b/backend/test/apps/webui/routers/test_models.py index a8495403b..34d3e30bd 100644 --- a/backend/test/apps/webui/routers/test_models.py +++ b/backend/test/apps/webui/routers/test_models.py @@ -42,7 +42,9 @@ class TestModels(AbstractPostgresTest): assert len(response.json()) == 1 with mock_webui_user(id="2"): - response = self.fast_api_client.get(self.create_url(query_params={"id": "my-model"})) + response = self.fast_api_client.get( + self.create_url(query_params={"id": "my-model"}) + ) assert response.status_code == 200 data = response.json()[0] assert data["id"] == "my-model"