diff --git a/netbox/netbox/middleware.py b/netbox/netbox/middleware.py index 7efc0708a..76b3e42a8 100644 --- a/netbox/netbox/middleware.py +++ b/netbox/netbox/middleware.py @@ -181,19 +181,19 @@ class MaintenanceModeMiddleware: def __call__(self, request): if get_config().MAINTENANCE_MODE: - self._prevent_db_write_operations( + self._set_session_type( allow_write=request.path_info.startswith(settings.MAINTENANCE_EXEMPT_PATHS) ) return self.get_response(request) @staticmethod - def _prevent_db_write_operations(allow_write=False): + def _set_session_type(allow_write): """ Prevent any write-related database operations. Args: - allow_write (bool): Whether to allow write operations. + allow_write (bool): If True, write operations will be permitted. """ with connection.cursor() as cursor: mode = 'READ WRITE' if allow_write else 'READ ONLY' diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index d9ca216ec..4d2dd8a81 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -480,9 +480,7 @@ AUTH_EXEMPT_PATHS = ( # All URLs starting with a string listed here are exempt from maintenance mode enforcement MAINTENANCE_EXEMPT_PATHS = ( - f'/{BASE_PATH}admin/extras/configrevision/', - f'/{BASE_PATH}login/', - f'/{BASE_PATH}logout/', + f'/{BASE_PATH}admin/', ) SERIALIZATION_MODULES = {