Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion libs/labelbox/src/labelbox/schema/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class IssueStatus(str, Enum):
# ---------------------------------------------------------------------------

_USER_FIELDS = (
"id email nickname name picture isViewer isExternalUser createdAt updatedAt"
"id email nickname name picture isViewer isExternalUser "
"createdAt updatedAt lastLoginAt"
)

_COMMENT_FIELDS = (
Expand Down
4 changes: 4 additions & 0 deletions libs/labelbox/src/labelbox/schema/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class User(DbObject):
Attributes:
updated_at (datetime)
created_at (datetime)
last_login_at (datetime or None): When this user last established a
session (login or workspace switch) in this organization. ``None``
until the user logs in after last-login tracking was enabled.
email (str)
name (str)
nickname (str)
Expand All @@ -28,6 +31,7 @@ class User(DbObject):

updated_at = Field.DateTime("updated_at")
created_at = Field.DateTime("created_at")
last_login_at = Field.DateTime("last_login_at")
email = Field.String("email")
name = Field.String("nickname")
nickname = Field.String("name")
Expand Down
3 changes: 3 additions & 0 deletions libs/labelbox/tests/integration/test_user_and_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ def test_user(client):
user = client.get_user()
assert user.uid is not None
assert user.organization() == client.get_organization()
assert hasattr(user, "last_login_at")
# Nullable: None until the user has logged in after tracking was enabled.
assert user.last_login_at is None or hasattr(user.last_login_at, "year")


def test_organization(client):
Expand Down
1 change: 1 addition & 0 deletions libs/labelbox/tests/unit/schema/test_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"isExternalUser": False,
"createdAt": _NOW,
"updatedAt": _NOW,
"lastLoginAt": _NOW,
}

_COMMENT_RAW = {
Expand Down
1 change: 1 addition & 0 deletions libs/labelbox/tests/unit/schema/test_project_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"isExternalUser": False,
"createdAt": _NOW,
"updatedAt": _NOW,
"lastLoginAt": _NOW,
}

_ISSUE_RAW = {
Expand Down
Loading