[PATCH v5 04/10] REST: Add Persons to the API
Finucane, Stephen
stephen.finucane at intel.com
Thu Jun 2 22:47:21 AEST 2016
On 26 May 20:12, Andy Doan wrote:
> This exports person objects via the REST API.
>
> Security Constraints:
> * The API is read-only to authenticated users
>
> Signed-off-by: Andy Doan <andy.doan at linaro.org>
One item below, which I can fix myself if I apply as is not blocking.
Reviewed-by: Stephen Finucane <stephen.finucane at intel.com>
> +class PersonSerializer(HyperlinkedModelSerializer):
> + class Meta:
> + model = Person
> + exclude = ('user',)
> +
> + def to_representation(self, instance):
> + data = super(PersonSerializer, self).to_representation(instance)
> + data['username'] = instance.user.username if instance.user else ''
Does it still make sense to keep this, seeing as you're removing it
in the next patch? OK for me to drop it here?
More information about the Patchwork
mailing list