Geuthur / aa-ledger

Character & Corporation Ledger Statistics for Alliance Auth
GNU General Public License v3.0
1 stars 0 forks source link

'Settings' object has no attribute 'LEDGER_MEMBERAUDIT_USE' #14

Closed rodpold closed 6 months ago

rodpold commented 6 months ago

Thank you for the quick bugfix. After installing version 0.4.0, I had another minor issue that I wanted to share: LEDGER_MEMBERAUDIT_USE is called optional in the readme.md, but it seems to cause an error if it doesn't have that value.

[22/May/2024 23:39:35] ERROR [django.request:241] Internal Server Error: /ledger/index
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/allianceauth/authentication/decorators.py", line 50, in _wrapped_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allianceauth/.local/lib/python3.11/site-packages/ledger/views/pve.py", line 18, in ledger_index
    "memberaudit": settings.LEDGER_MEMBERAUDIT_USE,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/conf/__init__.py", line 104, in __getattr__
    val = getattr(_wrapped, name)
          ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Settings' object has no attribute 'LEDGER_MEMBERAUDIT_USE'
Geuthur commented 6 months ago

@rodpold

Quik Fix is to put LEDGER_MEMBERAUDIT_USE = False at the end of the local.py

if you dont have memberaudit app installed