Open dawidwolski-identt opened 1 month ago
I feel like this is expected behaviour if all registry methods have been removed.
Maybe consider using a custom decorator, e.g.
def redirect_on_empty_registry(func):
@wraps(func)
def inner(request, *args, **kwargs):
if len(registry.get_methods()) == 0:
return redirect("somewhere-else")
return func(request, *args, **kwargs)
return inner
setup_view = redirect_on_empty_registry(SetupView.as_view())
Setup wizard crashes on MethodForm if registry is empty.
Expected Behavior
The wizard should show warning and do not allow user to proceed if there is no methods in the registry.
Current Behavior
HTTP 500 and
Possible Solution
Do not allow user to proceed to the method step (gray out Next button on "welcome" step) or show message instead of method list on "method" step.
Steps to Reproduce (for bugs)
Context
We allow administrators to select which methods are allowed. They can disable all methods. We can handle that case on our side or we can discuss and choose solution here.
Your Environment