2 Commits 31af320388 ... 7100af483b

Author SHA1 Message Date
  blezz-tech 7100af483b reminder for tickets with status IN_PROCESS 2 weeks ago
  blezz-tech 31af320388 reminder for tickets with status IN_PROCESS 2 weeks ago
1 changed files with 16 additions and 15 deletions
  1. 16 15
      handlers/st_request_in_process.py

+ 16 - 15
handlers/st_request_in_process.py

@@ -49,21 +49,22 @@ def send_wontfix_notification(user, ticket):
 def process_in_progress_ticket(ticket, start_time):
     tickets_new=jsreq.requestGetTicket_user(token, config.API_URL+f"tickets/api/ticket_list/{ticket.id}")
     for ticket_new in tickets_new:
-        if ticket_new.id in tickets:
-            tickets[ticket_new.id] = {
-                "reminders": 0,
-                "last_date_reminder": start_time
-            }
-        
-        if IS_INFINITE_REMINDER or tickets[ticket_new.id]['reminders'] < MAX_REMINDERS:
-            if (start_time - tickets[ticket_new.id]["last_date_reminder"]) > DEFAULT_REMINDER_INTERVAL:
-                send_reminder("st_request_in_process@ej.sharix-app.org", ticket_new)
-
-                tickets[ticket_new.id]["reminders"] += 1
-                tickets[ticket_new.id]["last_date_reminder"] += start_time
-        elif not IS_INFINITE_REMINDER and tickets[ticket_new.id]['reminders'] >= MAX_REMINDERS:
-            del tickets[ticket_new.id] 
-            # Функция смены статуса на WONTFIX
+        if ticket_new.status == 131:
+            if ticket_new.id in tickets:
+                tickets[ticket_new.id] = {
+                    "reminders": 0,
+                    "last_date_reminder": start_time
+                }
+            
+            if IS_INFINITE_REMINDER or tickets[ticket_new.id]['reminders'] < MAX_REMINDERS:
+                if (start_time - tickets[ticket_new.id]["last_date_reminder"]) > DEFAULT_REMINDER_INTERVAL:
+                    send_reminder("st_request_in_process@ej.sharix-app.org", ticket_new)
+
+                    tickets[ticket_new.id]["reminders"] += 1
+                    tickets[ticket_new.id]["last_date_reminder"] += start_time
+            elif not IS_INFINITE_REMINDER and tickets[ticket_new.id]['reminders'] >= MAX_REMINDERS:
+                del tickets[ticket_new.id] 
+                # Функция смены статуса на WONTFIX
 
 
 def status_changer():