Skip to content

Commit 474735f

Browse files
committed
explicitly override db_constraint in CustomForeignKey.__init__()
1 parent ef24b18 commit 474735f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

simple_history/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ def get_history_user(self, instance):
219219

220220
class CustomForeignKeyField(models.ForeignKey):
221221

222+
def __init__(self, *args, **kwargs):
223+
kwargs['db_constraint'] = False
224+
super(CustomForeignKeyField, self).__init__(*args, **kwargs)
225+
222226
def get_attname(self):
223227
return self.name
224228

0 commit comments

Comments
 (0)