Skip to content

Commit

Permalink
refactor: refactor user group model
Browse files Browse the repository at this point in the history
Signed-off-by: Jongmin Kim <[email protected]>
  • Loading branch information
whdalsrnt committed Nov 20, 2024
1 parent 2988c19 commit ea2166b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/spaceone/identity/model/user_group/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
}
1 change: 1 addition & 0 deletions src/spaceone/identity/model/user_group/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit ea2166b

Please sign in to comment.