Родитель
661191e126
Коммит
5d5aa82171
|
@ -145,7 +145,7 @@ class UserProfilePublicSerializer(UserProfileSerializer):
|
|||
user = instance.user
|
||||
|
||||
return EntrySerializer(
|
||||
user.entries.public(),
|
||||
user.entries.public().order_by('-id'),
|
||||
context=self.context,
|
||||
many=True,
|
||||
).data if user else []
|
||||
|
@ -153,7 +153,7 @@ class UserProfilePublicSerializer(UserProfileSerializer):
|
|||
created_entries = serializers.SerializerMethodField()
|
||||
|
||||
def get_created_entries(self, instance):
|
||||
entry_creator_records = OrderedCreatorRecord.objects.filter(creator__profile=instance)
|
||||
entry_creator_records = OrderedCreatorRecord.objects.filter(creator__profile=instance).order_by('-id')
|
||||
return [EntrySerializer(x.entry).data for x in entry_creator_records if x.entry.is_approved()]
|
||||
|
||||
my_profile = serializers.SerializerMethodField()
|
||||
|
|
|
@ -37,7 +37,7 @@ class TestProfileView(PulseMemberTestCase):
|
|||
created_entries = []
|
||||
entry_creators = OrderedCreatorRecord.objects.filter(
|
||||
creator__profile=id
|
||||
)
|
||||
).order_by('-id')
|
||||
|
||||
created_entries = [EntrySerializer(x.entry).data for x in entry_creators]
|
||||
self.assertEqual(entriesjson['profile_id'], id)
|
||||
|
|
Загрузка…
Ссылка в новой задаче