fix: remove duplicate exclusion block, replace continue with else branch

- Removed duplicate department exclusion check (was duplicated twice)
- Replaced 'continue' (invalid inside 'if ENABLE_AUTO_APPROVAL') with 'else:' branch
- Properly indented auto-approval logic inside the else block
This commit is contained in:
gitea
2026-07-04 18:50:40 +07:00
parent c3503975a0
commit 23960cbbb6
+1 -14
View File
@@ -899,20 +899,7 @@ def process_ticket_logic(req_id):
break
if is_excluded:
t_log(" ⏭ Пропуск: пользователь в исключённом отделе.")
continue
# Проверка: отдел пользователя в списке исключений
is_excluded = False
if user_department and APPROVAL_EXCLUDED_DEPARTMENTS:
for dept in APPROVAL_EXCLUDED_DEPARTMENTS:
if dept.lower() in user_department.lower() or user_department.lower() in dept.lower():
is_excluded = True
t_log(f" ⚠️ Отдел '{user_department}' в списке исключений — автосогласование отменено")
break
if is_excluded:
t_log(" ⏭ Пропуск: пользователь в исключённом отделе.")
continue
else:
if is_city_ok and (is_group_ok or is_cat_ok):
if manager_email:
t_log(f"✔ Условия совпали. Запуск процесса согласования для {manager_email}...")