Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feat/move-api-v0-functionality-to-v1' into feat/migrate…
Browse files Browse the repository at this point in the history
…-delete-user-to-api-v1
  • Loading branch information
jfcalvo committed May 13, 2024
2 parents edcec37 + 89d09e7 commit ef02e74
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/argilla_server/apis/v0/handlers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from argilla_server.contexts import accounts
from argilla_server.database import get_async_db
from argilla_server.errors import EntityAlreadyExistsError, EntityNotFoundError
from argilla_server.errors.future.base_errors import NotUniqueError
from argilla_server.errors.future import NotUniqueError
from argilla_server.policies import UserPolicy, authorize
from argilla_server.pydantic_v1 import parse_obj_as
from argilla_server.schemas.v0.users import User, UserCreate
Expand Down Expand Up @@ -95,7 +95,7 @@ async def create_user(
user = await accounts.create_user(db, user_create.dict(), user_create.workspaces)

telemetry.track_user_created(user)
except NotUniqueError as e:
except NotUniqueError:
raise EntityAlreadyExistsError(name=user_create.username, type=User)
except Exception as e:
raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=str(e))
Expand Down
2 changes: 1 addition & 1 deletion src/argilla_server/apis/v1/handlers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from argilla_server import models, telemetry
from argilla_server.contexts import accounts
from argilla_server.database import get_async_db
from argilla_server.errors.future.base_errors import NotUniqueError
from argilla_server.errors.future import NotUniqueError
from argilla_server.policies import UserPolicyV1, authorize
from argilla_server.schemas.v1.users import User, UserCreate, Users
from argilla_server.schemas.v1.workspaces import Workspaces
Expand Down
2 changes: 1 addition & 1 deletion src/argilla_server/contexts/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from sqlalchemy.orm import Session, selectinload

from argilla_server.enums import UserRole
from argilla_server.errors.future.base_errors import NotUniqueError
from argilla_server.errors.future import NotUniqueError
from argilla_server.models import User, Workspace, WorkspaceUser
from argilla_server.schemas.v0.users import UserCreate
from argilla_server.schemas.v0.workspaces import WorkspaceCreate, WorkspaceUserCreate
Expand Down
2 changes: 1 addition & 1 deletion src/argilla_server/errors/future/base_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__all__ = ["NotFoundError", "AuthenticationError"]
__all__ = ["NotFoundError", "NotUniqueError", "AuthenticationError"]


class NotFoundError(Exception):
Expand Down

0 comments on commit ef02e74

Please sign in to comment.