Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 Add user_id to api server profile #5002

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from enum import auto
from typing import Any, ClassVar

from models_library.basic_types import IdInt
from models_library.emails import LowerCaseEmailStr
from models_library.utils.enums import StrAutoEnum
from pydantic import BaseModel, Field, validator
Expand Down Expand Up @@ -28,6 +29,7 @@ class UserRoleEnum(StrAutoEnum):


class Profile(ProfileCommon):
id_: IdInt = Field(alias="id")
login: LowerCaseEmailStr
role: UserRoleEnum
groups: Groups | None = None
Expand All @@ -47,6 +49,7 @@ def enforce_role_upper(cls, v):
class Config:
schema_extra: ClassVar[dict[str, Any]] = {
"example": {
"id": "20",
"first_name": "James",
"last_name": "Maxwell",
"login": "james-maxwell@itis.swiss",
Expand Down