jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

cannot import name 'models' from 'two_factor' (v1.4) #522

Closed xmnlab closed 2 years ago

xmnlab commented 2 years ago

After updating django two factor auth to 1.4 I cannot import models anymore.

It seems that the new version doesn't have that file anymore.

we are using simple-history app and it created a migration that uses two_factor.models.key_validator reading the code, it seems that I need to import it from:

from two_factor.plugins.phonenumber.models import key_validator

as it is a breaking change, I wondering if it would be better to be versioned to version 2 instead of 1.4

PS: I am opening this issue just for the record as I didn't find anything in the gh issues

claudep commented 2 years ago

Duplicate of #510. It should have been version 2, yes, but now that it was released with version 1.14, what's done is done, sorry.