dashboard: adapt tile creation to cell base being a concrete class (#17645)

This commit is contained in:
Frédéric Péters 2018-01-08 10:45:35 +01:00
parent 3aba43b569
commit 84bb64e877
2 changed files with 2 additions and 0 deletions

View File

@ -26,6 +26,7 @@ def get_cell_data(cell):
if cell is None:
return {}
cell_data = serializers.serialize('python', [cell])[0]
cell_data['fields'].update(serializers.serialize('python', [cell.cellbase_ptr])[0]['fields'])
del cell_data['pk']
for key in ('restricted_to_unlogged', 'groups', 'last_update_timestamp',
'order', 'placeholder', 'public', 'page'):

View File

@ -59,6 +59,7 @@ class DashboardAddTileView(View):
if not cell.is_visible(request.user):
raise PermissionDenied()
cell.pk = None
cell.id = None
cell.page = dashboard.page
cell.placeholder = '_dashboard'
cell.save()