Skip to content

Commit

Permalink
Polish (#3692)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx authored Jan 19, 2025
1 parent 32a97e5 commit 122a9af
Show file tree
Hide file tree
Showing 77 changed files with 1,675 additions and 3,139 deletions.
1 change: 0 additions & 1 deletion backend/onyx/auth/noauth_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def load_no_auth_user_preferences(store: KeyValueStore) -> UserPreferences:
preferences_data = cast(
Mapping[str, Any], store.load(KV_NO_AUTH_USER_PREFERENCES_KEY)
)
print("preferences_data", preferences_data)
return UserPreferences(**preferences_data)
except KvKeyNotFoundError:
return UserPreferences(
Expand Down
11 changes: 9 additions & 2 deletions backend/onyx/server/features/persona/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from fastapi import Query
from fastapi import UploadFile
from pydantic import BaseModel
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Session

from onyx.auth.users import current_admin_user
Expand Down Expand Up @@ -277,8 +278,14 @@ def create_label(
_: User | None = Depends(current_user),
) -> PersonaLabelResponse:
"""Create a new assistant label"""
label_model = create_assistant_label(name=label.name, db_session=db)
return PersonaLabelResponse.from_model(label_model)
try:
label_model = create_assistant_label(name=label.name, db_session=db)
return PersonaLabelResponse.from_model(label_model)
except IntegrityError:
raise HTTPException(
status_code=400,
detail=f"Label with name '{label.name}' already exists. Please choose a different name.",
)


@admin_router.patch("/label/{label_id}")
Expand Down
1 change: 0 additions & 1 deletion backend/onyx/server/manage/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ def update_user_pinned_assistants(
store = get_kv_store()
no_auth_user = fetch_no_auth_user(store)
no_auth_user.preferences.pinned_assistants = ordered_assistant_ids
print("ordered_assistant_ids", ordered_assistant_ids)
set_no_auth_user_preferences(store, no_auth_user.preferences)
return
else:
Expand Down
1 change: 1 addition & 0 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const cspHeader = `

/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
output: "standalone",
publicRuntimeConfig: {
version,
Expand Down
133 changes: 133 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-radio-group": "^1.2.2",
"@radix-ui/react-scroll-area": "^1.2.2",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
Expand Down
Loading

0 comments on commit 122a9af

Please sign in to comment.