Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #495 from torchbox/chore/dark-transparent-theme-su…
Browse files Browse the repository at this point in the history
…b-service-page

Data migration and update to service and sub-service page themes
  • Loading branch information
helenb authored Jul 4, 2023
2 parents 978c79f + 7bdd47a commit 2467a27
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tbx/services/migrations/0038_data_migration_subservice_theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.db import migrations

def update_theme(apps, schema_editor):
page = apps.get_model('services', 'SubServicePage')
page.objects.filter(theme='dark--transparent').update(theme='light')

class Migration(migrations.Migration):

dependencies = [
('services', '0037_alter_subservicepage_content'),
]

operations = [
migrations.RunPython(update_theme),
]
18 changes: 18 additions & 0 deletions tbx/services/migrations/0039_data_migration_service_theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.18 on 2023-06-23 10:08

from django.db import migrations

def update_theme(apps, schema_editor):
page = apps.get_model('services', 'ServicePage')
page.objects.filter(theme='dark--transparent').update(theme='light')


class Migration(migrations.Migration):

dependencies = [
('services', '0038_data_migration_subservice_theme'),
]

operations = [
migrations.RunPython(update_theme),
]
23 changes: 23 additions & 0 deletions tbx/services/migrations/0040_update_services_theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.18 on 2023-06-23 10:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('services', '0039_data_migration_service_theme'),
]

operations = [
migrations.AlterField(
model_name='servicepage',
name='theme',
field=models.CharField(choices=[('light', 'Light'), ('coral', 'Coral'), ('dark', 'Dark')], default='light', max_length=255),
),
migrations.AlterField(
model_name='subservicepage',
name='theme',
field=models.CharField(choices=[('light', 'Light'), ('coral', 'Coral'), ('dark', 'Dark')], default='light', max_length=255),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 3.2.18 on 2023-06-27 09:56

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('services', '0038_call_to_action'),
('services', '0040_update_services_theme'),
]

operations = [
]
1 change: 0 additions & 1 deletion tbx/services/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class BaseServicePage(Page):
("light", "Light"),
("coral", "Coral"),
("dark", "Dark"),
("dark--transparent", "Dark with transparent header"),
),
default="light",
)
Expand Down

0 comments on commit 2467a27

Please sign in to comment.