From 7bb079366927807e9ccd044828bbf5fc1c63e9d9 Mon Sep 17 00:00:00 2001 From: Hex Date: Thu, 10 Jul 2025 12:47:01 -0700 Subject: [PATCH] moving info over from personal gitlab to self-hosted gitea --- AutoColor2.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/AutoColor2.py b/AutoColor2.py index 2324442..c95beab 100644 --- a/AutoColor2.py +++ b/AutoColor2.py @@ -126,8 +126,7 @@ def smart_make_tags(queues,users,tags,driver): original_window = driver.current_window_handle tag_count = count_tags(queues,tags) for tag in tags: - if found_string(users, tag.text.lower()) == False: - lowest_queue = find_lowest_and_increment(tag_count) + if not found_string(users, tag.text.lower()): driver.execute_script("arguments[0].scrollIntoView(true);", tag) tag_href = tag.find_element(By.TAG_NAME, "a").get_attribute("href") driver.execute_script("window.open(arguments[0]);", tag_href) @@ -144,9 +143,12 @@ def smart_make_tags(queues,users,tags,driver): ) finally: tag_field = driver.find_element(By.ID, "tag_id") - tag_field.send_keys(Keys.END) - tag_field.send_keys("/",lowest_queue) - tag_field.send_keys(Keys.ENTER) + current_tag_value = tag_field.get_attribute("value") + if not found_string(users, current_tag_value): + lowest_queue = find_lowest_and_increment(tag_count) + tag_field.send_keys(Keys.END) + tag_field.send_keys("/",lowest_queue) + tag_field.send_keys(Keys.ENTER) WebDriverWait(driver,5).until(EC.presence_of_element_located((By.ID,'stepListHeader'))) driver.close() driver.switch_to.window(original_window)