From b775eb56cfc86d72630cca125d0fb8ca51eb7471 Mon Sep 17 00:00:00 2001 From: Smirking Kitsune <36494751+SmirkingKitsune@users.noreply.github.com> Date: Wed, 22 May 2024 00:09:39 -0700 Subject: [PATCH] Bug fix for a Bug Fix test_my_prompt_custom_script.py Changed the checks for `state.skippped` due to a bad interaction with `excluded_keywords` . It was possible for a user to cause a `job_no` calculation error if the `skipped` command was called when an `excluded_keyword` job should be skipped. This fixes it so that the user cannot cause a calculation error using the `skipped` command by incrementing the `excluded_jobs` count when a excluded keyword is present. --- scripts/test_my_prompt_custom_script.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/test_my_prompt_custom_script.py b/scripts/test_my_prompt_custom_script.py index d89c929..7981ab8 100644 --- a/scripts/test_my_prompt_custom_script.py +++ b/scripts/test_my_prompt_custom_script.py @@ -82,6 +82,8 @@ class Script(scripts.Script): if state.skipped: print("Job skipped.") state.skipped = False + if f >= 0 and prompt_array[f].strip() in excluded_keywords_list: + exluded_jobs = exluded_jobs + 1 continue # Check for excluded keywords