소스 검색

fix db maintenance mode exception #12966

Abhimanyu Saharan 2 년 전
부모
커밋
c83b2499f0
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/netbox/middleware.py

+ 1 - 1
netbox/netbox/middleware.py

@@ -203,7 +203,7 @@ class MaintenanceModeMiddleware:
         """
         Prevent any write-related database operations if an exception is raised.
         """
-        if isinstance(exception, InternalError):
+        if get_config().MAINTENANCE_MODE and isinstance(exception, InternalError):
             error_message = 'NetBox is currently operating in maintenance mode and is unable to perform write ' \
                             'operations. Please try again later.'