Skip to content

Commit

Permalink
Add email in User model
Browse files Browse the repository at this point in the history
  • Loading branch information
svetleo-evidently committed Apr 8, 2024
1 parent 9d48bc2 commit 7cfe0be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/evidently/ui/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def from_team(cls, team: Team):
class UserModel(BaseModel):
id: UserID
name: str
email: str

@classmethod
def from_user(cls, user: User):
return TeamModel(id=user.id, name=user.name)
return UserModel(id=user.id, name=user.name, email=user.email)
5 changes: 3 additions & 2 deletions src/evidently/ui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Team(BaseModel):
class User(BaseModel):
id: UserID = Field(default_factory=uuid.uuid4)
name: str
email: str = ""


def _default_dashboard():
Expand Down Expand Up @@ -406,10 +407,10 @@ def delete_team(self, user_id: UserID, team_id: TeamID):
self._delete_team(team_id)

@abstractmethod
def _list_team_users(self, team_id: TeamID) -> List[User]:
def _list_team_users(self, team_id: TeamID) -> List[UserID]:
raise NotImplementedError

def list_team_users(self, user_id: UserID, team_id: TeamID) -> List[User]:
def list_team_users(self, user_id: UserID, team_id: TeamID) -> List[UserID]:
if not self.check_team_permission(user_id, team_id, TeamPermission.READ):
raise TeamNotFound()
return self._list_team_users(team_id)
Expand Down
2 changes: 1 addition & 1 deletion src/evidently/ui/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _list_user_teams(self, user_id: UserID, include_virtual: bool) -> List[Team]
def _delete_team(self, team_id: TeamID):
pass

def _list_team_users(self, team_id: TeamID) -> List[User]:
def _list_team_users(self, team_id: TeamID) -> List[UserID]:
return []


Expand Down

0 comments on commit 7cfe0be

Please sign in to comment.