# -*- coding: utf-8 -*-

# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.


from akvo.rsr.models import User

from .rsr_serializer import BaseRSRSerializer


class UserSerializer(BaseRSRSerializer):

    class Meta:
        model = User
        fields = (
            'first_name',
            'last_name',
            'email',
        )

@@ -275,17 +275,16 @@
 tml %3E.%0A%0A
-%0A
 from akv
@@ -309,16 +309,70 @@
 t User%0A%0A
+from .organisation import OrganisationExtraSerializer%0A
 from .rs
@@ -591,8 +591,633 @@
       )%0A
+%0A%0Aclass UserExtraSerializer(BaseRSRSerializer):%0A%0A    organisation = OrganisationExtraSerializer(source='get_profile.organisation')%0A%0A    class Meta:%0A        model = User%0A        fields = (%0A            'first_name',%0A            'last_name',%0A            'organisation',%0A        )%0A        exclude = ('absolute_url',)%0A%0A    def __init__(self, *args, **kwargs):%0A        %22%22%22 Delete the 'absolute_url' field added in BaseRSRSerializer.__init__().%0A        It's neither correct nor do we want this data to be visible.%0A        %22%22%22%0A        super(UserExtraSerializer, self).__init__(*args, **kwargs)%0A        del self.fields%5B'absolute_url'%5D

Add UserExtraSerializer