diff --git a/label_studio/users/api.py b/label_studio/users/api.py index b0b1d84735ce..28c05e43edc2 100644 --- a/label_studio/users/api.py +++ b/label_studio/users/api.py @@ -317,8 +317,8 @@ def get(self, request, *args, **kwargs): name='get', decorator=extend_schema( tags=['Users'], - summary='Retrieve my user', - description='Retrieve details of the account that you are using to access the API.', + summary='Whoami for current user', + description='Make the whoami call on behalf of the user you are using to access the API.', request=None, responses={200: WhoAmIUserSerializer}, extensions={ diff --git a/label_studio/users/serializers.py b/label_studio/users/serializers.py index 3181d7c8e947..6efa2a33140d 100644 --- a/label_studio/users/serializers.py +++ b/label_studio/users/serializers.py @@ -1,5 +1,7 @@ """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ +from typing import TypedDict + from core.utils.common import load_func from django.conf import settings from rest_flex_fields import FlexFieldsModelSerializer @@ -7,11 +9,18 @@ from users.models import User +class ActiveOrganizationMeta(TypedDict): + title: str + email: str + + class BaseUserSerializer(FlexFieldsModelSerializer): # short form for user presentation initials = serializers.SerializerMethodField(default='?', read_only=True) avatar = serializers.SerializerMethodField(read_only=True) - active_organization_meta = serializers.SerializerMethodField(read_only=True) + active_organization_meta = serializers.SerializerMethodField( + help_text='Active organization metadata', read_only=True + ) last_activity = serializers.DateTimeField(read_only=True, source='last_activity_cached') def get_avatar(self, instance): @@ -20,7 +29,7 @@ def get_avatar(self, instance): def get_initials(self, instance): return instance.get_initials(self._is_deleted(instance)) - def get_active_organization_meta(self, instance): + def get_active_organization_meta(self, instance) -> ActiveOrganizationMeta: organization = instance.active_organization if organization is None: return {'title': '', 'email': ''} diff --git a/poetry.lock b/poetry.lock index 5194a477f4c8..c1d3daaec851 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2130,13 +2130,13 @@ testing = ["pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementat [[package]] name = "label-studio-sdk" -version = "2.0.7" +version = "2.0.14" description = "" optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip", hash = "sha256:a29f9b9db793edfb97cbf384a2c9aac780656ca37893c998e412577f4e9277ad"}, + {file = "0ba3578cdf1165fd468feceacdb94a522179a27d.zip", hash = "sha256:43b7fef2b0f3428e47497968c60d6b9ad597bd67a7f0609d070ca420b4b8eea7"}, ] [package.dependencies] @@ -2149,7 +2149,7 @@ jsonschema = ">=4.23.0" lxml = ">=4.2.5" nltk = ">=3.9.1,<4.0.0" numpy = ">=1.26.4,<3.0.0" -opencv-python = ">=4.12.0,<5.0.0" +opencv-python-headless = ">=4.12.0,<5.0.0" pandas = ">=0.24.0" Pillow = ">=11.3.0" pydantic = ">=1.9.2" @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/0ba3578cdf1165fd468feceacdb94a522179a27d.zip" [[package]] name = "launchdarkly-server-sdk" @@ -2731,20 +2731,20 @@ typing-extensions = ">=4.7,<5" datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] [[package]] -name = "opencv-python" +name = "opencv-python-headless" version = "4.12.0.88" description = "Wrapper package for OpenCV python bindings." optional = false python-versions = ">=3.6" groups = ["main"] files = [ - {file = "opencv-python-4.12.0.88.tar.gz", hash = "sha256:8b738389cede219405f6f3880b851efa3415ccd674752219377353f017d2994d"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:f9a1f08883257b95a5764bf517a32d75aec325319c8ed0f89739a57fae9e92a5"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:812eb116ad2b4de43ee116fcd8991c3a687f099ada0b04e68f64899c09448e81"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:51fd981c7df6af3e8f70b1556696b05224c4e6b6777bdd2a46b3d4fb09de1a92"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:092c16da4c5a163a818f120c22c5e4a2f96e0db4f24e659c701f1fe629a690f9"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-win32.whl", hash = "sha256:ff554d3f725b39878ac6a2e1fa232ec509c36130927afc18a1719ebf4fbf4357"}, - {file = "opencv_python-4.12.0.88-cp37-abi3-win_amd64.whl", hash = "sha256:d98edb20aa932fd8ebd276a72627dad9dc097695b3d435a4257557bbb49a79d2"}, + {file = "opencv-python-headless-4.12.0.88.tar.gz", hash = "sha256:cfdc017ddf2e59b6c2f53bc12d74b6b0be7ded4ec59083ea70763921af2b6c09"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:1e58d664809b3350c1123484dd441e1667cd7bed3086db1b9ea1b6f6cb20b50e"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:365bb2e486b50feffc2d07a405b953a8f3e8eaa63865bc650034e5c71e7a5154"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:aeb4b13ecb8b4a0beb2668ea07928160ea7c2cd2d9b5ef571bbee6bafe9cc8d0"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:236c8df54a90f4d02076e6f9c1cc763d794542e886c576a6fee46ec8ff75a7a9"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-win32.whl", hash = "sha256:fde2cf5c51e4def5f2132d78e0c08f9c14783cd67356922182c6845b9af87dbd"}, + {file = "opencv_python_headless-4.12.0.88-cp37-abi3-win_amd64.whl", hash = "sha256:86b413bdd6c6bf497832e346cd5371995de148e579b9774f8eba686dee3f5528"}, ] [package.dependencies] @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "27d1096f39b9864ce20797fcaabcdf470de9b87aedf0b2bfe0b7b109096320a0" +content-hash = "0e20aec08dc28af23b1797dc93b64dfefef3a61fea99f0b784840aa43c16b91c" diff --git a/pyproject.toml b/pyproject.toml index cb1a83035a58..debdc8a74b31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/0ba3578cdf1165fd468feceacdb94a522179a27d.zip", ## HumanSignal repo dependencies :end ]