django2.2: add default mandatory on_delete on OneToOneField

This commit is contained in:
klmp200 committed 2019-10-08 22:46:02 +02:00
1 parent 4dadb1dbc0
commit 6cc234e8d3
7 files changed
+25 -8

No files matched your search

+3 -1
View File
@@ -421,7 +421,9 @@ class ForumUserInfo(models.Model):
user, such as the favourite topics, the signature, and so on...
"""
user = models.OneToOneField(User, related_name="_forum_infos")
user = models.OneToOneField(
User, related_name="_forum_infos", on_delete=models.CASCADE
)
last_read_date = models.DateTimeField(
_("last read date"),
default=datetime(