Skip to content

Commit 9309247

Browse files
committed
Add comment about null FK validation
1 parent a22651b commit 9309247

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

morango/models/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,8 @@ def deferred_clean_fields(self):
900900
for field in self._meta.fields:
901901
if not isinstance(field, models.ForeignKey):
902902
continue
903+
# by not excluding the field if it's null, the default validation logic will apply
904+
# and should raise a ValidationError if the FK field is not nullable
903905
if getattr(self, field.attname) is None:
904906
continue
905907
excluded_fields.append(field.name)

0 commit comments

Comments
 (0)