2 Commits 1ccc25b53c ... 4bd495e1d7

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

+ 8 - 8
handlers/st_request_in_process.py

@@ -56,15 +56,15 @@ def process_in_progress_ticket(ticket_list, start_time):
                     "last_date_reminder": start_time
                 }
             
-            if IS_INFINITE_REMINDER or tickets[ticket.id]['reminders'] < MAX_REMINDERS:
-                if (start_time - tickets[ticket.id]["last_date_reminder"]) > DEFAULT_REMINDER_INTERVAL:
+            if (start_time - tickets[ticket.id]["last_date_reminder"]) > DEFAULT_REMINDER_INTERVAL:
+                if IS_INFINITE_REMINDER or tickets[ticket.id]['reminders'] < MAX_REMINDERS:
                     send_reminder("st_request_in_process@ej.sharix-app.org", ticket)
-
-                    tickets[ticket.id]["reminders"] += 1
-                    tickets[ticket.id]["last_date_reminder"] += start_time
-            elif not IS_INFINITE_REMINDER and tickets[ticket.id]['reminders'] >= MAX_REMINDERS:
-                del tickets[ticket.id] 
-                # Функция смены статуса на WONTFIX
+                else:
+                    del tickets[ticket.id] 
+                    # Функция смены статуса на WONTFIX
+                
+                tickets[ticket.id]["reminders"] += 1
+                tickets[ticket.id]["last_date_reminder"] += start_time
 
 
 def status_changer():