feat(sqlalchemy): formatting

This commit is contained in:
Jonathan Rohde 2024-06-25 08:35:55 +02:00
parent d4b6b7c4e8
commit 23e4d9daff
3 changed files with 6 additions and 3 deletions

View File

@ -113,7 +113,8 @@ class AuthsTable:
Session.add(result) Session.add(result)
user = Users.insert_new_user( 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.commit()
Session.refresh(result) Session.refresh(result)

View File

@ -176,7 +176,7 @@ def upgrade() -> None:
sa.Column("api_key", sa.String(), nullable=True), sa.Column("api_key", sa.String(), nullable=True),
sa.Column("settings", apps.webui.internal.db.JSONField(), nullable=True), sa.Column("settings", apps.webui.internal.db.JSONField(), nullable=True),
sa.Column("info", 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.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("api_key"), sa.UniqueConstraint("api_key"),
sa.UniqueConstraint("oauth_sub"), sa.UniqueConstraint("oauth_sub"),

View File

@ -42,7 +42,9 @@ class TestModels(AbstractPostgresTest):
assert len(response.json()) == 1 assert len(response.json()) == 1
with mock_webui_user(id="2"): 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 assert response.status_code == 200
data = response.json()[0] data = response.json()[0]
assert data["id"] == "my-model" assert data["id"] == "my-model"