2 Commits cff02355e4 ... e9a7e5d5e9

Author SHA1 Message Date
  blezz-tech e9a7e5d5e9 reminder for tickets with status IN_PROCESS 2 weeks ago
  blezz-tech cff02355e4 reminder for tickets with status IN_PROCESS 2 weeks ago
1 changed files with 3 additions and 4 deletions
  1. 3 4
      handlers/st_request_in_process.py

+ 3 - 4
handlers/st_request_in_process.py

@@ -42,6 +42,8 @@ def send_reminder_notification(ticket):
     print(f"Отправлено напоминание пользователю {user} о тикете {ticket.id}")
 
 def send_wontfix_notification(ticket):
+    jsreq.requestPatchTicketUser(token, config.API_URL+f"tickets/api/tickets/{ticket.id}", 149)
+
     user = "TEST_USER"
 
     message = f"Уведомление: тикет {ticket.id} был отмечен как WONTFIX из-за отсутствия действий"
@@ -52,8 +54,6 @@ def send_wontfix_notification(ticket):
 
     print(f"Отправлено уведомление пользователю {user} о WONTFIX для тикета {ticket.id}")
 
-
-
 def ticket_worker(ticket, start_time):
     if ticket.status == 131:
         print(tickets_nt)
@@ -69,13 +69,12 @@ def ticket_worker(ticket, start_time):
             tickets_nt[ticket.id]["reminders"] += 1
             tickets_nt[ticket.id]["last_date_reminder"] = start_time
 
-            if IS_INFINITE_REMINDER or tickets_nt[ticket.id]['reminders'] < MAX_REMINDERS:
+            if IS_INFINITE_REMINDER or tickets_nt[ticket.id]['reminders'] <= MAX_REMINDERS:
                 send_reminder_notification(ticket)
             else:
                 del tickets_nt[ticket.id]
                 send_wontfix_notification(ticket)
 
-
 def ticket_list_worker(ticket_list, start_time):
     tickets=jsreq.requestGetTicket_user(token, config.API_URL+f"tickets/api/ticket_list/{ticket_list.id}")
     for ticket in tickets: