Просмотр исходного кода

FIxes #7972: Standardize name of RemoteUserBackend logger

jeremystretch 4 лет назад
Родитель
Сommit
f1350a1022
2 измененных файлов с 6 добавлено и 5 удалено
  1. 1 0
      docs/release-notes/version-3.1.md
  2. 5 5
      netbox/netbox/authentication.py

+ 1 - 0
docs/release-notes/version-3.1.md

@@ -10,6 +10,7 @@
 
 * [#7246](https://github.com/netbox-community/netbox/issues/7246) - Don't attempt to URL-decode NAPALM response payloads
 * [#7962](https://github.com/netbox-community/netbox/issues/7962) - Fix user menu under report/script result view
+* [#7972](https://github.com/netbox-community/netbox/issues/7972) - Standardize name of `RemoteUserBackend` logger
 * [#8097](https://github.com/netbox-community/netbox/issues/8097) - Fix styling of Markdown tables
 * [#8127](https://github.com/netbox-community/netbox/issues/8127) - Fix disassociation of interface under IP address edit view
 * [#8131](https://github.com/netbox-community/netbox/issues/8131) - Restore annotation of available IPs under prefix IPs view

+ 5 - 5
netbox/netbox/authentication.py

@@ -105,7 +105,7 @@ class RemoteUserBackend(_RemoteUserBackend):
         return settings.REMOTE_AUTH_AUTO_CREATE_USER
 
     def configure_groups(self, user, remote_groups):
-        logger = logging.getLogger('netbox.authentication.RemoteUserBackend')
+        logger = logging.getLogger('netbox.auth.RemoteUserBackend')
 
         # Assign default groups to the user
         group_list = []
@@ -141,7 +141,7 @@ class RemoteUserBackend(_RemoteUserBackend):
         Return None if ``create_unknown_user`` is ``False`` and a ``User``
         object with the given username is not found in the database.
         """
-        logger = logging.getLogger('netbox.authentication.RemoteUserBackend')
+        logger = logging.getLogger('netbox.auth.RemoteUserBackend')
         logger.debug(
             f"trying to authenticate {remote_user} with groups {remote_groups}")
         if not remote_user:
@@ -173,7 +173,7 @@ class RemoteUserBackend(_RemoteUserBackend):
             return None
 
     def _is_superuser(self, user):
-        logger = logging.getLogger('netbox.authentication.RemoteUserBackend')
+        logger = logging.getLogger('netbox.auth.RemoteUserBackend')
         superuser_groups = settings.REMOTE_AUTH_SUPERUSER_GROUPS
         logger.debug(f"Superuser Groups: {superuser_groups}")
         superusers = settings.REMOTE_AUTH_SUPERUSERS
@@ -189,7 +189,7 @@ class RemoteUserBackend(_RemoteUserBackend):
         return bool(result)
 
     def _is_staff(self, user):
-        logger = logging.getLogger('netbox.authentication.RemoteUserBackend')
+        logger = logging.getLogger('netbox.auth.RemoteUserBackend')
         staff_groups = settings.REMOTE_AUTH_STAFF_GROUPS
         logger.debug(f"Superuser Groups: {staff_groups}")
         staff_users = settings.REMOTE_AUTH_STAFF_USERS
@@ -204,7 +204,7 @@ class RemoteUserBackend(_RemoteUserBackend):
         return bool(result)
 
     def configure_user(self, request, user):
-        logger = logging.getLogger('netbox.authentication.RemoteUserBackend')
+        logger = logging.getLogger('netbox.auth.RemoteUserBackend')
         if not settings.REMOTE_AUTH_GROUP_SYNC_ENABLED:
             # Assign default groups to the user
             group_list = []