Просмотр исходного кода

Исправлена проверка времени мероприятия

Vildan 2 лет назад
Родитель
Сommit
5c5acf3e30
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      bot/functions.py

+ 5 - 2
bot/functions.py

@@ -155,8 +155,11 @@ def check_overlap(start, end, date):
     db = database.Database()
     times = db.sql_fetchall(f"select e_start,e_end from events_table where e_date = {date}")
     for time in times:
-        it.addi(time['e_start'], time['e_end'])
-    return not it.overlaps(start, end)
+        if time['e_start'] > time['e_end']:
+            return False
+        else:
+            it.addi(time['e_start'], time['e_end'])
+            return not it.overlaps(start, end)
 
 
 def parse_events(data):