diff --git a/api/tacticalrmm/alerts/models.py b/api/tacticalrmm/alerts/models.py index 0b951011..278af079 100644 --- a/api/tacticalrmm/alerts/models.py +++ b/api/tacticalrmm/alerts/models.py @@ -515,6 +515,8 @@ class Alert(models.Model): "execution_time": 0, "retcode": status, } + else: + return # command was successful if isinstance(r, dict): @@ -685,6 +687,8 @@ class Alert(models.Model): "execution_time": 0, "retcode": status, } + else: + return # command was successful if isinstance(r, dict): @@ -724,7 +728,7 @@ class Alert(models.Model): value = get_db_value(string=f"{model}.{prop}", instance=self) if value is not None: - temp_arg = temp_arg.replace(string, str(value)) + temp_arg = temp_arg.replace(string, f"'{str(value)}'") temp_args.append(temp_arg)