Migrating Likes and votes serializers

remotes/origin/issue/4795/notification_even_they_are_disabled
Jesús Espino 2016-07-05 20:29:59 +02:00
parent cbec0caca2
commit a51ca8c85a
2 changed files with 14 additions and 14 deletions

View File

@ -17,14 +17,14 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.auth import get_user_model
from taiga.base.api import serializers from taiga.base.api import serializers
from taiga.base.fields import Field, MethodField
class FanSerializer(serializers.ModelSerializer): class FanSerializer(serializers.LightSerializer):
full_name = serializers.CharField(source='get_full_name', required=False) id = Field()
username = Field()
full_name = MethodField()
class Meta: def get_full_name(self, obj):
model = get_user_model() return obj.get_full_name()
fields = ('id', 'username', 'full_name')

View File

@ -17,14 +17,14 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.auth import get_user_model
from taiga.base.api import serializers from taiga.base.api import serializers
from taiga.base.fields import Field, MethodField
class VoterSerializer(serializers.ModelSerializer): class VoterSerializer(serializers.LightSerializer):
full_name = serializers.CharField(source='get_full_name', required=False) id = Field()
username = Field()
full_name = MethodField()
class Meta: def get_full_name(self, obj):
model = get_user_model() return obj.get_full_name()
fields = ('id', 'username', 'full_name')