diff --git a/src/spaceone/identity/model/user_group/database.py b/src/spaceone/identity/model/user_group/database.py index 968ab4c..e3717db 100644 --- a/src/spaceone/identity/model/user_group/database.py +++ b/src/spaceone/identity/model/user_group/database.py @@ -10,19 +10,22 @@ class UserGroup(MongoModel): tags = DictField(Default=None) workspace_id = StringField(max_length=40, required=True) domain_id = StringField(max_length=40) + created_at = DateTimeField(auto_now_add=True) meta = { "updatable_fields": ["name", "description", "users", "tags"], "minimal_fields": [ "user_group_id", "name", - "users", "workspace_id", "domain_id", ], - "ordering": ["name", "user_group_id"], + "change_query_keys": {"user_id": "users"}, + "ordering": ["name"], "indexes": [ "name", "workspace_id", + "domain_id", + "users", ], } diff --git a/src/spaceone/identity/model/user_group/response.py b/src/spaceone/identity/model/user_group/response.py index b051671..af43542 100644 --- a/src/spaceone/identity/model/user_group/response.py +++ b/src/spaceone/identity/model/user_group/response.py @@ -18,6 +18,7 @@ class UserGroupResponse(BaseModel): def dict(self, *args, **kwargs): data = super().dict(*args, **kwargs) data["created_at"] = utils.datetime_to_iso8601(data["created_at"]) + return data