Skip to content

Commit 4af134d

Browse files
authored
Tech debt - remove old settings (#294)
* Delete address settings * Delete unused Tag snippet * Remove unused import * Leave the tag class in place for historical migrations to work * Add merge migration
1 parent ebba81f commit 4af134d

File tree

4 files changed

+52
-25
lines changed

4 files changed

+52
-25
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Django 4.2.11 on 2024-07-24 09:40
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("torchbox", "0034_add_earth_colour_theme"),
10+
]
11+
12+
operations = [
13+
migrations.DeleteModel(
14+
name="GlobalSettings",
15+
),
16+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.11 on 2024-07-24 10:55
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("torchbox", "0035_remove_address_settings"),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name="tag",
15+
name="name",
16+
),
17+
migrations.RemoveField(
18+
model_name="tag",
19+
name="slug",
20+
),
21+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generated by Django 4.2.11 on 2024-07-25 09:00
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("torchbox", "0035_add_important_page_settings"),
10+
("torchbox", "0036_delete_unused_tag_snippet"),
11+
]
12+
13+
operations = []

tbx/core/models.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
SocialFields,
1010
)
1111
from tbx.people.models import ContactMixin
12-
from wagtail import blocks
1312
from wagtail.admin.panels import FieldPanel, InlinePanel, MultiFieldPanel
1413
from wagtail.blocks import PageChooserBlock, StreamBlock, StructBlock
1514
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
@@ -196,31 +195,9 @@ class StandardPage(
196195
]
197196

198197

199-
# Currently hidden. These were used in the past and may be used again in the future
200-
# @register_snippet
198+
# No longer in use but kept for migration history
201199
class Tag(models.Model):
202-
name = models.CharField(max_length=255)
203-
slug = models.CharField(max_length=255)
204-
205-
def __str__(self):
206-
return self.name
207-
208-
209-
class BaseAddress(blocks.StructBlock):
210-
title = blocks.CharBlock(blank=True)
211-
address = blocks.RichTextBlock(blank=True)
212-
213-
214-
@register_setting
215-
class GlobalSettings(BaseSiteSetting):
216-
addresses = StreamField([("address", BaseAddress())], blank=True)
217-
218-
panels = [
219-
FieldPanel("addresses"),
220-
]
221-
222-
class Meta:
223-
verbose_name = "Global Settings"
200+
pass
224201

225202

226203
class SubMenuItemBlock(StreamBlock):

0 commit comments

Comments
 (0)