Skip to content

Commit

Permalink
Merge pull request #6033 from gitcoinco/fix-kudos-serializer
Browse files Browse the repository at this point in the history
Fix kudos serializer
  • Loading branch information
thelostone-mc authored Feb 20, 2020
2 parents 6c543fe + f71657f commit ff94b78
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions app/dashboard/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from django.db.models import Count, F

import django_filters.rest_framework
from kudos.models import KudosTransfer
from kudos.models import KudosTransfer, Token
from rest_framework import routers, serializers, viewsets
from retail.helpers import get_ip

Expand Down Expand Up @@ -79,11 +79,30 @@ class Meta:
fields = ('kudos_token_cloned_from', )


class KudosTokenSerializer(serializers.ModelSerializer):
"""Handle serializing the Kudos object."""

class Meta:
"""Define the kudos serializer metadata."""

model = Token
fields = ('price_finney', 'num_clones_allowed', 'num_clones_in_wild',
'num_clones_available_counting_indirect_send',
'cloned_from_id', 'popularity', 'popularity_week',
'popularity_month', 'popularity_quarter', 'name',
'override_display_name', 'description',
'image', 'rarity', 'tags', 'artist', 'platform',
'external_url', 'background_color', 'owner_address',
'txid', 'token_id', 'hidden',
'send_enabled_for_non_gitcoin_admins',
'preview_img_mode', 'suppress_sync', 'kudos_token_cloned_from')


class ActivitySerializer(serializers.ModelSerializer):
"""Handle serializing the Activity object."""

profile = ProfileSerializer()
kudos = KudosSerializer()
kudos = KudosTokenSerializer()

class Meta:
"""Define the activity serializer metadata."""
Expand Down

0 comments on commit ff94b78

Please sign in to comment.