ForeignKey(unique=True) is usually better served by a OneToOneField.
cnobile2012 opened this issue · 2 comments
cnobile2012 commented
Found this issue also.
security.PasswordExpiry.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
I have personally run into this before and swapping out the ForeignKey for the OneToOneField had been backwards compatible, meaning old could should not break.
funkaoshi commented
Thanks, this was reported by someone else as well. Will investigate making the change.
koziolk commented
Having the same issue with django==1.11.8 and django-security==0.9.4