]> git.0d.be Git - panikdb.git/commitdiff
don't abort on soundfiles removed even if there are stats about them
authorFrédéric Péters <fpeters@0d.be>
Mon, 20 Apr 2015 19:12:13 +0000 (21:12 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 20 Apr 2015 19:12:13 +0000 (21:12 +0200)
panikdb/stats/migrations/0002_auto_20150420_2110.py [new file with mode: 0644]
panikdb/stats/models.py

diff --git a/panikdb/stats/migrations/0002_auto_20150420_2110.py b/panikdb/stats/migrations/0002_auto_20150420_2110.py
new file mode 100644 (file)
index 0000000..30bfdff
--- /dev/null
@@ -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 = [
+        ('stats', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='dailystat',
+            name='soundfile',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, to='emissions.SoundFile', null=True),
+            preserve_default=True,
+        ),
+    ]
index ca4a5685b141e00942c35437fce5d10cc0e8c293..39a9e57f38d69cb7d459af80a45bf9a8fc7be3dc 100644 (file)
@@ -4,7 +4,7 @@ from emissions.models import SoundFile
 
 
 class DailyStat(models.Model):
-    soundfile = models.ForeignKey(SoundFile)
+    soundfile = models.ForeignKey(SoundFile, on_delete=models.SET_NULL, null=True)
     day = models.DateField()
     nb_events = models.IntegerField()
     nb_visits = models.IntegerField()