sdelements/django-security

ForeignKey(unique=True) is usually better served by a OneToOneField.

cnobile2012 opened this issue · 2 comments

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.

Thanks, this was reported by someone else as well. Will investigate making the change.

Having the same issue with django==1.11.8 and django-security==0.9.4