-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.3: Jobs models from disabled plugins result in inconsistent UI behavior #1563
Comments
On the one hand, this is incorrect usage (after installing or uninstalling a plugin you should run |
Just as a quick initial pass, catching the exception and printing an error message like this: index 5c570b600..d2ded44f6 100644
--- a/nautobot/extras/views.py
+++ b/nautobot/extras/views.py
@@ -950,7 +950,12 @@ class JobView(ObjectPermissionRequiredMixin, View):
def get(self, request, class_path=None, slug=None):
job_model = self._get_job_model_or_404(class_path, slug)
- job_form = job_model.job_class().as_form(initial=normalize_querydict(request.GET))
+ try:
+ job_form = job_model.job_class().as_form(initial=normalize_querydict(request.GET))
+ except RuntimeError as err:
+ job_form = None
+ messages.error(request, f"Unable to run or schedule job: {err}")
+
schedule_form = forms.JobScheduleForm(initial=normalize_querydict(request.GET))
return render(
(END) So not perfect or ideal, because you can still click the "Run/Schedule" button which results in the same 500 error. Ideally we'd want to go back to the preceding page and display the error there. |
Closed with #1590 |
Environment
Steps to Reproduce
example_plugin
(PLUGINS = ["example_plugin"]
innautobot_config.py
)example_plugin
example_plugin
innautobot_config.py
Expected Behavior
Job should not run, displaying an error in UI.
Observed Behavior
500 error with
The text was updated successfully, but these errors were encountered: