mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 05:53:11 +00:00
feat(sqlalchemy): formatting
This commit is contained in:
parent
d4b6b7c4e8
commit
23e4d9daff
@ -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)
|
||||||
|
@ -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"),
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user