From 81f1fb6dbf71664f60c4149648d3fe50cf9a6778 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Mon, 23 Jul 2018 16:03:52 -0700 Subject: [PATCH 1/2] Remove some user private information from API v1 --- docs/api/v1.rst | 14 ++++---------- readthedocs/api/base.py | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/api/v1.rst b/docs/api/v1.rst index a8c9e047130..2e4446d3f88 100644 --- a/docs/api/v1.rst +++ b/docs/api/v1.rst @@ -403,22 +403,16 @@ User .. sourcecode:: js { - "first_name": "", - "id": "1", - "last_login": "2010-10-28T13:38:13.022687", - "last_name": "", - "resource_uri": "/api/v1/user/1/", + "id": "1", + "resource_uri": "/api/v1/user/1/", "username": "testuser" } - :>json string first_name: First name. :>json string id: User id. - :>json string last_login: Timestamp of last login. - :>json string last_name: Last name. :>json string resource_uri: URI for this user. :>json string username: User name. - - + + Versions -------- .. http:get:: /api/v1/version/ diff --git a/readthedocs/api/base.py b/readthedocs/api/base.py index 7725d5261be..12caab01324 100644 --- a/readthedocs/api/base.py +++ b/readthedocs/api/base.py @@ -193,7 +193,7 @@ class UserResource(ModelResource): class Meta(object): allowed_methods = ['get'] queryset = User.objects.all() - fields = ['username', 'first_name', 'last_name', 'last_login', 'id'] + fields = ['username', 'id'] filtering = { 'username': 'exact', } From 5f6e9d40424abaaec1407daeab8ff4154ba01939 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Mon, 23 Jul 2018 16:28:58 -0700 Subject: [PATCH 2/2] Add note about field removal to the docs --- docs/api/v1.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/v1.rst b/docs/api/v1.rst index 2e4446d3f88..24ddc0831bd 100644 --- a/docs/api/v1.rst +++ b/docs/api/v1.rst @@ -412,6 +412,10 @@ User :>json string resource_uri: URI for this user. :>json string username: User name. +.. important:: + + This API was changed after the initial release to remove private fields. + Versions --------