03: check connector parameter is here and do save on tile
This commit is contained in:
parent
f51e0b7fbd
commit
acfe3fe868
|
@ -8,7 +8,7 @@ import json
|
|||
from combo.apps.dashboard.models import Tile
|
||||
from combo.data.models import ConfigJsonCell, Page
|
||||
|
||||
page = Page.objects.get(title='Mon compte')
|
||||
page = Page.objects.get(title='Tuiles')
|
||||
cons = [
|
||||
{'old': 'bla-dev', 'new': 'site-web'},
|
||||
{'old': 'news-dev', 'new': 'actualites'},
|
||||
|
@ -32,9 +32,9 @@ for con in cons:
|
|||
|
||||
# tiles
|
||||
for tile in Tile.objects.all():
|
||||
if tile.cell.parameters['connector'] == con['old']:
|
||||
if 'connector' in tile.cell.parameters and tile.cell.parameters['connector'] == con['old']:
|
||||
tile.cell.parameters['connector'] = con['new']
|
||||
tile.save()
|
||||
tile.cell.save()
|
||||
nb_updated_tiles += 1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue