Set report's reason to cascade deletion if the reason is deleted

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-19 22:14:59 -07:00
parent 6bda7f4f2d
commit daeb7849e8

View File

@@ -247,7 +247,7 @@ class Report(models.Model):
# The report that was made by this user # The report that was made by this user
record = models.ForeignKey("ReportRecord", on_delete=models.CASCADE) record = models.ForeignKey("ReportRecord", on_delete=models.CASCADE)
# Reason for this report # Reason for this report
reason = models.ForeignKey("ReportReason", on_delete=models.SET_NULL, null=True) reason = models.ForeignKey("ReportReason", on_delete=models.CASCADE)
# IP address of the reporter # IP address of the reporter
ip = models.GenericIPAddressField() ip = models.GenericIPAddressField()