robinhood / deux

Multifactor Authentication for Django Rest Framework
Other
155 stars 56 forks source link

Update for Python 3.7 #23

Open dcarlcf opened 5 years ago

dcarlcf commented 5 years ago

I am building a Django backend and would love to incorporate this module. After I added it to my settings, I tried running the migration and got a syntax error:

TypeError: init() missing 1 required positional argument: 'on_delete'

From abstract models line 31:

File "/Users/duncancockfoster/Desktop/nftg_django_backend/env/lib/python3.7/site-packages/deux/abstract_models.py", line 31

I noticed that it is only supported up through Python 3.5 - will support be added for Python 3.7? Pretty sure that is the issue here.

dcarlcf commented 5 years ago

Wait nevermind ... it looks like the abstract_models.py file here is the correct one, and the one installed by pip install deux is incorrect. I replaced the file that pip install deux installed with the abstract_models.py on this github and it worked.

Is the version on pip not updated?

brett-matthews commented 5 years ago

i found this too today, pip install has the abstract model without on_delete attr