debug free slots
This commit is contained in:
+3
-2
@@ -207,7 +207,7 @@ def getFreeSlots(vkPost) -> dict:
|
||||
logger.error("Ответ не получен")
|
||||
return {}
|
||||
slotsDataFull = response.json()
|
||||
if len(slotsDataFull.keys()) == 0:
|
||||
if not slotsDataFull or len(slotsDataFull.keys()) == 0:
|
||||
logger.error("Нет свободных приемов")
|
||||
return {}
|
||||
firstKey = list(slotsDataFull.keys())[0]
|
||||
@@ -231,6 +231,7 @@ def setDynamicText():
|
||||
freeSlots = getFreeSlots(vkPost)
|
||||
if len(freeSlots.keys()) == 0:
|
||||
logger.error("Нет свободных приемов")
|
||||
vkPost.dynamic_text = ""
|
||||
return vkPost
|
||||
userIds = [int(key) for key in freeSlots["slots"].keys()]
|
||||
usersMedods = UsersMedods.query.filter(UsersMedods.id.in_(userIds)).all()
|
||||
@@ -268,4 +269,4 @@ def setDynamicText():
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка при обновлении списка докторов: {e}")
|
||||
return
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user