👔(backend) object user on DocumentAccessSerializer

user field was displaying the userid, but we
need to return the user object on the
DocumentAccessSerializer, so we can show the
user email on the frontend.
We add the user_id field in write_only mode, so
we can keep create and update.
This commit is contained in:
Anthony LC
2024-05-31 17:06:39 +02:00
committed by Anthony LC
parent f039b2aa3b
commit 7b5698a370
7 changed files with 96 additions and 13 deletions

View File

@@ -225,6 +225,7 @@ def test_api_templates_retrieve_authenticated_related_team_readers_or_editors(
"retrieve": True,
"set_role_to": [],
"update": False,
"partial_update": False,
}
assert sorted(content.pop("accesses"), key=lambda x: x["id"]) == sorted(
[
@@ -331,6 +332,7 @@ def test_api_templates_retrieve_authenticated_related_team_administrators(
"retrieve": True,
"set_role_to": ["administrator", "editor"],
"update": True,
"partial_update": True,
},
},
{
@@ -343,6 +345,7 @@ def test_api_templates_retrieve_authenticated_related_team_administrators(
"retrieve": True,
"set_role_to": ["administrator", "reader"],
"update": True,
"partial_update": True,
},
},
{
@@ -355,6 +358,7 @@ def test_api_templates_retrieve_authenticated_related_team_administrators(
"retrieve": True,
"set_role_to": ["editor", "reader"],
"update": True,
"partial_update": True,
},
},
{
@@ -367,6 +371,7 @@ def test_api_templates_retrieve_authenticated_related_team_administrators(
"retrieve": True,
"set_role_to": [],
"update": False,
"partial_update": False,
},
},
{
@@ -445,6 +450,7 @@ def test_api_templates_retrieve_authenticated_related_team_owners(
"retrieve": True,
"set_role_to": ["owner", "administrator", "editor"],
"update": True,
"partial_update": True,
},
},
{
@@ -457,6 +463,7 @@ def test_api_templates_retrieve_authenticated_related_team_owners(
"retrieve": True,
"set_role_to": ["owner", "administrator", "reader"],
"update": True,
"partial_update": True,
},
},
{
@@ -469,6 +476,7 @@ def test_api_templates_retrieve_authenticated_related_team_owners(
"retrieve": True,
"set_role_to": ["owner", "editor", "reader"],
"update": True,
"partial_update": True,
},
},
{
@@ -484,6 +492,7 @@ def test_api_templates_retrieve_authenticated_related_team_owners(
if other_access.role == "owner"
else [],
"update": other_access.role == "owner",
"partial_update": other_access.role == "owner",
},
},
{