From f473e5dd61a0fff4ae4a52470a5fe9e0290a168a Mon Sep 17 00:00:00 2001 From: Nikita Manovich <40690625+nmanovic@users.noreply.github.com> Date: Tue, 2 Jun 2020 18:52:32 +0300 Subject: [PATCH] Remove information about the email from the basic user information (#1627) * Remove information about the email from the basic user information. --- CHANGELOG.md | 2 +- cvat/apps/engine/serializers.py | 2 +- cvat/apps/engine/tests/_test_rest_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ac40d112e4..858ec855c722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Throttling policy for unauthenticated users () ### Changed -- +- Removed information about e-mail from the basic user information () ### Deprecated - diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index 207915201492..8d047e0d8f7d 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -328,7 +328,7 @@ def validate(self, data): class Meta: model = User - fields = ('url', 'id', 'username', 'first_name', 'last_name', 'email') + fields = ('url', 'id', 'username', 'first_name', 'last_name') ordering = ['-id'] class UserSerializer(serializers.ModelSerializer): diff --git a/cvat/apps/engine/tests/_test_rest_api.py b/cvat/apps/engine/tests/_test_rest_api.py index 46c6f3e56662..c8bee86c4609 100644 --- a/cvat/apps/engine/tests/_test_rest_api.py +++ b/cvat/apps/engine/tests/_test_rest_api.py @@ -552,8 +552,8 @@ def _check_data(self, user, data, is_full): self.assertEqual(data["username"], user.username) self.assertEqual(data["first_name"], user.first_name) self.assertEqual(data["last_name"], user.last_name) - self.assertEqual(data["email"], user.email) extra_check = self.assertIn if is_full else self.assertNotIn + extra_check("email", data) extra_check("groups", data) extra_check("is_staff", data) extra_check("is_superuser", data)