Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid checking if otp_yubikey should be used #252

Open
mrowqa opened this issue Feb 22, 2018 · 1 comment
Open

Invalid checking if otp_yubikey should be used #252

mrowqa opened this issue Feb 22, 2018 · 1 comment

Comments

@mrowqa
Copy link

mrowqa commented Feb 22, 2018

Expected Behavior

If otp_yubikey is installed in current environment (venv), but absent in INSTALLED_APPS, then tests which use login should work.

Current Behavior

Tests crash with:

RuntimeError: Model class otp_yubikey.models.YubikeyDevice doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Possible Solution

Instead of trying to import otp_yubikey and catching ImportError you can check if otp_yubikey is present in INSTALLED_APPS.

Steps to Reproduce (for bugs)

Well, I don't have minimal example, but here is the change I am working (patchset 2 failed due to this problem). I have ran it locally and pasted the reason above.
https://gerrit.sio2project.mimuw.edu.pl/#/c/2946/

Your Environment

  • Browser and version: Google Chrome 64.0.3282.167 64-bit
  • Python version: 2.7.6
  • Django version: 1.9.13
  • django-otp version: 0.4.2
  • django-two-factor-auth version: 1.5.0 (latest for Django 1.9)
@Bouke
Copy link
Collaborator

Bouke commented Feb 22, 2018

@Bouke Bouke removed the enhancement label Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants