Browse Source

fix(ui) Fix platform icons not showing on issue list (#12367)

The project stub inside the group was lacking its platform property
which is necessary to display the correct icon.

Fixes SEN-254
Mark Story 6 years ago
parent
commit
f78597a7df

+ 1 - 0
src/sentry/api/serializers/models/group.py

@@ -375,6 +375,7 @@ class GroupSerializerBase(Serializer):
                 'id': six.text_type(obj.project.id),
                 'name': obj.project.name,
                 'slug': obj.project.slug,
+                'platform': obj.project.platform,
             },
             'type': obj.get_event_type(),
             'metadata': obj.get_event_metadata(),

+ 11 - 0
tests/sentry/api/serializers/test_group.py

@@ -20,6 +20,17 @@ from sentry.testutils import TestCase
 
 
 class GroupSerializerTest(TestCase):
+    def test_project(self):
+        user = self.create_user()
+        group = self.create_group()
+
+        result = serialize(group, user)
+        assert result['project']
+        assert 'id' in result['project']
+        assert 'name' in result['project']
+        assert 'slug' in result['project']
+        assert 'platform' in result['project']
+
     def test_is_ignored_with_expired_snooze(self):
         now = timezone.now().replace(microsecond=0)