remove coms from deleted users

parent 1ad2ff2e
......@@ -55,7 +55,7 @@ class DocumentComment(models.Model):
content = models.CharField(max_length=10000)
commentDate = models.DateTimeField()
isModerated = models.BooleanField(default=False)
user = models.ForeignKey('User',on_delete=models.SET_NULL,null=True,blank=True)
user = models.ForeignKey('User',on_delete=models.CASCADE,null=True,blank=True)
document = models.ForeignKey('Document',on_delete=models.CASCADE)
def __str__(self):
......@@ -66,7 +66,7 @@ class CourseComment(models.Model):
content = models.CharField(max_length=10000)
commentDate = models.DateTimeField()
isModerated = models.BooleanField(default=False)
user = models.ForeignKey('User',on_delete=models.SET_NULL,null=True,blank=True)
user = models.ForeignKey('User',on_delete=models.CASCADE,null=True,blank=True)
course = models.ForeignKey('Course',on_delete=models.CASCADE)
def __str__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment