Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #340 from aldryn/features/prevent_unwanted_article…
Browse files Browse the repository at this point in the history
…_deletion

Don't cascade delete from featured_image
  • Loading branch information
mkoistinen committed Jan 7, 2016
2 parents 09a745a + 54f30cf commit 1b00c68
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 2 deletions.
29 changes: 29 additions & 0 deletions aldryn_newsblog/migrations/0008_auto_20160106_1735.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import filer.fields.image
import django.db.models.deletion
import app_data.fields


class Migration(migrations.Migration):

dependencies = [
('aldryn_newsblog', '0007_default_newsblog_config'),
]

operations = [
migrations.AlterField(
model_name='article',
name='featured_image',
field=filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='filer.Image', null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='newsblogconfig',
name='app_data',
field=app_data.fields.AppDataField(default=b'{}', editable=False),
preserve_default=True,
),
]
4 changes: 2 additions & 2 deletions aldryn_newsblog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class Article(TranslatedAutoSlugifyMixin,
db_index=True)
is_featured = models.BooleanField(_('is featured'), default=False,
db_index=True)
featured_image = FilerImageField(null=True, blank=True)

featured_image = FilerImageField(null=True, blank=True,
on_delete=models.SET_NULL)
tags = TaggableManager(blank=True)

related = SortedManyToManyField('self', verbose_name=_('related articles'),
Expand Down

0 comments on commit 1b00c68

Please sign in to comment.