File tree 1 file changed +6
-1
lines changed
bolt/bolt/internal/handlers
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 14
14
from bolt .http .multipartparser import MultiPartParserError
15
15
from bolt .logs import log_response
16
16
from bolt .runtime import settings
17
+ from bolt .utils .module_loading import import_string
17
18
from bolt .views .errors import ErrorView
18
19
19
20
@@ -132,7 +133,11 @@ def handle_uncaught_exception():
132
133
def get_error_view (status_code ):
133
134
views_by_status = settings .HTTP_ERROR_VIEWS
134
135
if status_code in views_by_status :
135
- return views_by_status [status_code ].as_view ()
136
+ view = views_by_status [status_code ]
137
+ if isinstance (view , str ):
138
+ # Import the view if it's a string
139
+ view = import_string (view )
140
+ return view .as_view ()
136
141
137
142
# Create a standard view for any other status code
138
143
return ErrorView .as_view (status_code = status_code )
You can’t perform that action at this time.
0 commit comments