django-mfa2 icon indicating copy to clipboard operation
django-mfa2 copied to clipboard

NameError in mfa/models.py

Open swainn opened this issue 5 years ago • 1 comments

Tests for my project started failing with version 2.0.5 of django-mfa2. Here's the traceback:

Traceback (most recent call last):
  File "/Users/travis/build/Aquaveo/tethys/tethys_portal/manage.py", line 20, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/travis/miniconda/envs/tethys/lib/python3.7/site-packages/mfa/models.py", line 7, in <module>
    JSONField.register_lookup(hasLookup)
NameError: name 'hasLookup' is not defined

Full Test output here: https://travis-ci.org/github/Aquaveo/tethys/jobs/748432868#L1647

I'm using a PostgreSQL database and django 2.2.14

swainn avatar Dec 08 '20 23:12 swainn

Sorry, about that. I'll invest some time in the weekend, to add tests to avoid these silly issues

mkalioby avatar Dec 09 '20 04:12 mkalioby