Merge branch 'hotfix/snapshots-without-creator' into develop
This commit is contained in:
commit
83024fa198
|
|
@ -168,7 +168,7 @@ class SnapshotNode(DjangoObjectType):
|
|||
|
||||
@staticmethod
|
||||
def resolve_creator(parent, info, **kwargs):
|
||||
return f'{parent.creator.first_name} {parent.creator.last_name}'
|
||||
return f'{parent.creator.first_name} {parent.creator.last_name}' if parent.creator else ''
|
||||
|
||||
@staticmethod
|
||||
def resolve_objective_groups(parent, info, **kwargs):
|
||||
|
|
|
|||
|
|
@ -414,3 +414,13 @@ class SnapshotTestCase(SkillboxTestCase):
|
|||
}
|
||||
})
|
||||
self.assertIsNotNone(result.get('errors'))
|
||||
|
||||
def test_snapshot_without_creator(self):
|
||||
self.snapshot.creator = None
|
||||
self.snapshot.shared = True
|
||||
self.snapshot.save()
|
||||
result = self.client.execute(MODULE_SNAPSHOTS_QUERY, variables={
|
||||
"slug": self.slug
|
||||
})
|
||||
self.assertIsNone(result.get('errors'))
|
||||
self.assertEqual(len(result.get('data').get('module').get('snapshots')), 1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue