Hey Paulo,

It looks like a copy-pasta error :)

OneToOneField create a unique constraint on the field which is obviously not suitable in this case because a user can perform more than one action.

Edited the snippet to use ForeignKey instead of OneToOneField.

Thanks for the comment Paulo.

Written by

Full Stack Developer, Team Leader, Independent. More from me at https://hakibenita.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store