Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
23e4d9da
Commit
23e4d9da
authored
Jun 25, 2024
by
Jonathan Rohde
Browse files
feat(sqlalchemy): formatting
parent
d4b6b7c4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
backend/apps/webui/models/auths.py
backend/apps/webui/models/auths.py
+2
-1
backend/migrations/versions/7e5b5dc7342b_init.py
backend/migrations/versions/7e5b5dc7342b_init.py
+1
-1
backend/test/apps/webui/routers/test_models.py
backend/test/apps/webui/routers/test_models.py
+3
-1
No files found.
backend/apps/webui/models/auths.py
View file @
23e4d9da
...
@@ -113,7 +113,8 @@ class AuthsTable:
...
@@ -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
)
...
...
backend/migrations/versions/7e5b5dc7342b_init.py
View file @
23e4d9da
...
@@ -176,7 +176,7 @@ def upgrade() -> None:
...
@@ -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"
),
...
...
backend/test/apps/webui/routers/test_models.py
View file @
23e4d9da
...
@@ -42,7 +42,9 @@ class TestModels(AbstractPostgresTest):
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment