Skip to content

Commit

Permalink
remove background image from page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Jul 23, 2024
1 parent bfbaa22 commit 384ffc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
17 changes: 17 additions & 0 deletions snippets/migrations/0040_remove_pagelayout_background_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.7 on 2024-07-23 16:39

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("snippets", "0039_alter_pagelayout_layout"),
]

operations = [
migrations.RemoveField(
model_name="pagelayout",
name="background_image",
),
]
14 changes: 1 addition & 13 deletions snippets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,23 +507,11 @@ class PageLayout(TranslatableMixin, models.Model):
('default', 'Default'),
)
layout = models.CharField(max_length=255, choices=LAYOUT_CHOICES, default='default')
background_image = models.ForeignKey(
'wagtailimages.Image',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)

@property
def background_image_api_response(self):
return build_image_url(self.background_image)

api_fields = ('layout', 'background_image_api_response')
api_fields = ('layout',)

panels = [
FieldPanel('layout'),
FieldPanel('background_image')
]

def __str__(self):
Expand Down

0 comments on commit 384ffc1

Please sign in to comment.