Skip to content

Commit

Permalink
fix db maintenance mode exception #12966
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 authored and jeremystretch committed Jun 23, 2023
1 parent 79c8219 commit c83b249
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/netbox/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def process_exception(self, request, exception):
"""
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.'

Expand Down

0 comments on commit c83b249

Please sign in to comment.