From c22bbd97a0bd1a923293e7f68b8fbfa6e3bd19f2 Mon Sep 17 00:00:00 2001 From: Oleksii Malakhov Date: Sun, 6 Sep 2020 12:32:24 +0300 Subject: [PATCH] #17: models.py: Add on_delete=CASCADE for User foreign key; --- twython_django_oauth/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twython_django_oauth/models.py b/twython_django_oauth/models.py index bb9ce71..04fe548 100644 --- a/twython_django_oauth/models.py +++ b/twython_django_oauth/models.py @@ -10,6 +10,6 @@ class TwitterProfile(models.Model): oauth_secret in relation to a user. Adapt this if you have a current setup, there's really nothing special going on here. """ - user = models.OneToOneField(User) + user = models.OneToOneField(User, on_delete=models.CASCADE) oauth_token = models.CharField(max_length=200) oauth_secret = models.CharField(max_length=200)