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

Commit

Permalink
Fix cascading special coverage deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
camsom committed Apr 23, 2015
1 parent b350af6 commit 3207540
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions bulbs/special_coverage/migrations/0003_auto_20150423_2007.py
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('special_coverage', '0002_auto_20150318_2110'),
]

operations = [
migrations.AlterField(
model_name='specialcoverage',
name='campaign',
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, default=None, blank=True, to='campaigns.Campaign', null=True),
preserve_default=True,
),
]
3 changes: 2 additions & 1 deletion bulbs/special_coverage/models.py
Expand Up @@ -21,7 +21,8 @@ class SpecialCoverage(models.Model):
videos = JSONField(default=[], blank=True)
active = models.BooleanField(default=False)
promoted = models.BooleanField(default=False)
campaign = models.ForeignKey(Campaign, null=True, default=None, blank=True)
campaign = models.ForeignKey(
Campaign, null=True, default=None, blank=True, on_delete=models.SET_NULL)

def __unicode__(self):
return self.name
Expand Down

0 comments on commit 3207540

Please sign in to comment.