fix changeset parsing on prefetch_related with manytomany

This commit is contained in:
Laura Klünder 2017-06-17 21:50:15 +02:00
parent cb4867614c
commit f0d4d122da
2 changed files with 60 additions and 11 deletions

View file

@ -76,7 +76,7 @@ class EditorViewSet(ViewSet):
levels, levels_on_top, levels_under = self._get_levels_pk(request, level)
# don't prefetch groups for now as changesets do not yet work with m2m-prefetches
levels = Level.objects.filter(pk__in=levels).prefetch_related('buildings', 'spaces', 'doors',
'spaces__holes', # 'spaces__groups',
'spaces__holes', 'spaces__groups',
'spaces__columns')
levels = {s.pk: s for s in levels}