mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Allow logged in user to change some of its data. Administrators can lock users using the is_active field.
This commit is contained in:
1 parent
1f0ceb6f74
commit
6dd0f4d4d3
4 files changed
+101
-6
No files matched your search
@@ -28,6 +28,7 @@ class UserBase(BaseModel):
|
||||
"""
|
||||
|
||||
username: Optional[str] = Field(None, min_length=3, regex="[a-zA-Z0-9_-]+$")
|
||||
is_active: bool = True
|
||||
email: Optional[EmailStr]
|
||||
full_name: Optional[str]
|
||||
|
||||
@@ -49,11 +50,20 @@ class UserUpdate(UserBase):
|
||||
password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
|
||||
|
||||
|
||||
class LoggedInUserUpdate(BaseModel):
|
||||
"""
|
||||
Properties to update a logged in user.
|
||||
"""
|
||||
|
||||
password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
|
||||
email: Optional[EmailStr]
|
||||
full_name: Optional[str]
|
||||
|
||||
|
||||
class User(DateTimeModelMixin, UserBase):
|
||||
|
||||
user_id: UUID
|
||||
last_login: Optional[datetime] = None
|
||||
is_active: bool = True
|
||||
is_superadmin: bool = False
|
||||
|
||||
class Config:
|
||||
|
||||
Reference in new issue
Block a user