danfairs / django-lazysignup

django-lazysignup is a package designed to allow users to interact with a site as if they were authenticated users, but without signing up. At any time, they can convert their temporary user account to a real user account.
BSD 3-Clause "New" or "Revised" License
410 stars 89 forks source link

Django 2.0+ `on_delete` compatibility #61

Closed glowka closed 6 years ago

glowka commented 6 years ago

Upgrading Django to 2.0+ version causes an error:

File "/home/tomek/Project/pp/env/lib/python3.6/site-packages/lazysignup/models.py", line 80, in <module>
    class LazyUser(models.Model):
File "/home/tomek/Project/pp/env/lib/python3.6/site-packages/lazysignup/models.py", line 81, in LazyUser
    user = models.OneToOneField(constants.LAZYSIGNUP_USER_MODEL)
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Which seems to be caused by the change mentioned in 2.0 release notes:

The on_delete argument for ForeignKey and OneToOneField is now required in models and migrations. Consider squashing migrations so that you have fewer of them to update.

danfairs commented 6 years ago

This was fixed in #60.