fix db maintenance mode exception #12966

This commit is contained in:
Abhimanyu Saharan 2023-06-23 18:11:32 +05:30 committed by Jeremy Stretch
parent 79c8219202
commit c83b2499f0

View File

@ -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.'