mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 02:46:53 +00:00
Return created_in_version property in users.get_current_user
This commit is contained in:
parent
ed60a27d1a
commit
97b9bbc4a9
@ -2,6 +2,7 @@ from datetime import datetime
|
||||
|
||||
from apiserver.apierrors import errors
|
||||
from apiserver.apimodels.users import CreateRequest
|
||||
from apiserver.config.info import get_version
|
||||
from apiserver.database.errors import translate_errors_context
|
||||
from apiserver.database.model.user import User
|
||||
|
||||
@ -14,7 +15,11 @@ class UserBLL:
|
||||
if user_id and User.objects(id=user_id).only("id"):
|
||||
raise errors.bad_request.UserIdExists(id=user_id)
|
||||
|
||||
user = User(**request.to_struct(), created=datetime.utcnow())
|
||||
user = User(
|
||||
**request.to_struct(),
|
||||
created=datetime.utcnow(),
|
||||
created_in_version=get_version(),
|
||||
)
|
||||
user.save(force_insert=True)
|
||||
|
||||
@staticmethod
|
||||
|
@ -20,4 +20,5 @@ class User(DbModelMixin, Document):
|
||||
given_name = StringField(user_set_allowed=True)
|
||||
avatar = StringField()
|
||||
preferences = DynamicField(default="", exclude_by_default=True)
|
||||
created_in_version = StringField()
|
||||
created = DateTimeField()
|
||||
|
@ -166,6 +166,14 @@ get_current_user {
|
||||
}
|
||||
}
|
||||
}
|
||||
"2.31": ${get_current_user."2.26"} {
|
||||
response.properties {
|
||||
user.properties.created_in_version {
|
||||
type: string
|
||||
description: Server version at user creation time
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_all_ex {
|
||||
|
Loading…
Reference in New Issue
Block a user