1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Optimize config queries

This commit is contained in:
jeremystretch
2021-10-26 13:41:56 -04:00
parent 41ff1d0fc9
commit fbf91dda7d
15 changed files with 77 additions and 37 deletions

View File

@@ -13,7 +13,7 @@ from django.utils.http import is_safe_url
from django.views.decorators.debug import sensitive_post_parameters
from django.views.generic import View
from netbox.config import Config
from netbox.config import get_config
from utilities.forms import ConfirmationForm
from .forms import LoginForm, PasswordChangeForm, TokenForm
from .models import Token
@@ -53,7 +53,7 @@ class LoginView(View):
# If maintenance mode is enabled, assume the database is read-only, and disable updating the user's
# last_login time upon authentication.
if Config().MAINTENANCE_MODE:
if get_config().MAINTENANCE_MODE:
logger.warning("Maintenance mode enabled: disabling update of most recent login time")
user_logged_in.disconnect(update_last_login, dispatch_uid='update_last_login')