summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorroot <root@lalalizard.com>2012-12-24 07:15:11 -0500
committerroot <root@lalalizard.com>2012-12-24 12:06:12 -0500
commit7deba15052b6e9611525078c0530a444ac8abc99 (patch)
treed825faa8ec25ad2990469d02e62a276969f32cbe /backend
parent6c9d1c1cdc5985bb836306f6ae7dc83b014c9f77 (diff)
fix in models to avoid object delete
Diffstat (limited to 'backend')
-rw-r--r--backend/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/models.py b/backend/models.py
index e131f66..fd12ff5 100644
--- a/backend/models.py
+++ b/backend/models.py
@@ -67,7 +67,7 @@ class SJUserProfileAdmin(admin.ModelAdmin):
class SJUserActivity(models.Model):
""" ScannerJammer abstract user activity model
"""
- user = models.ForeignKey(auth.models.User)
+ user = models.ForeignKey(auth.models.User, null=True, on_delete=models.SET_NULL)
datetime = models.DateTimeField(blank=True)
class Meta:
@@ -113,7 +113,7 @@ class SJContent(SJUserActivity, SJSettingsModel):
(u'background', u'Background'),
)
- room = models.ForeignKey(SJRoom)
+ room = models.ForeignKey(SJRoom, null=True, on_delete=models.SET_NULL)
content_type = models.CharField(max_length=32, choices=CONTENT_TYPE)
old_id = models.IntegerField(default=0, blank=True)
@@ -141,7 +141,7 @@ class SJContentAdmin(admin.ModelAdmin):
class SJLike(SJUserActivity):
""" ScannerJammer like model
"""
- content = models.ForeignKey(SJContent)
+ content = models.ForeignKey(SJContent, null=True, on_delete=models.SET_NULL)
class Meta:
verbose_name = "SJ Like"