Commit 286eadfb authored by Matheus Miranda's avatar Matheus Miranda
Browse files

update field name

parent 120f1d56
......@@ -134,14 +134,14 @@ class UsersByClassSerializer(serializers.Serializer):
class UserStatsSerializer(serializers.ModelSerializer):
last_access = serializers.SerializerMethodField()
accesses_count = serializers.SerializerMethodField()
created_topics = serializers.SerializerMethodField()
topics = serializers.SerializerMethodField()
reactions = serializers.SerializerMethodField()
comments = serializers.SerializerMethodField()
class Meta:
model = User
fields = ('name', 'username', 'email', 'id', 'image', 'groups',
'last_access', 'accesses_count', 'created_topics', 'reactions',
'last_access', 'accesses_count', 'topics', 'reactions',
def get_last_access(self, obj):
......@@ -152,7 +152,7 @@ class UserStatsSerializer(serializers.ModelSerializer):
time_delta = - timedelta(days=7)
return obj.actor_actions.filter(timestamp__gte=time_delta).count()
def get_created_topics(self, obj):
def get_topics(self, obj):
return Topic.objects.filter(author=obj).count()
def get_reactions(self, obj):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment