Ошибка при отсутствии Проектов и проектов Ветро
This commit is contained in:
6
utils.py
6
utils.py
@@ -49,6 +49,7 @@ def db_update():
|
|||||||
logger.info(f"{Fore.YELLOW}Обновление Тегов...\n{Fore.RESET}")
|
logger.info(f"{Fore.YELLOW}Обновление Тегов...\n{Fore.RESET}")
|
||||||
|
|
||||||
clock_tags = clock.get_tags(is_updating=True, **{"page-size": clock.tags_count})
|
clock_tags = clock.get_tags(is_updating=True, **{"page-size": clock.tags_count})
|
||||||
|
if clock_tags:
|
||||||
db_tags = db.get_tags()
|
db_tags = db.get_tags()
|
||||||
new_tags = [tag for tag in clock_tags if tag not in db_tags]
|
new_tags = [tag for tag in clock_tags if tag not in db_tags]
|
||||||
|
|
||||||
@@ -65,8 +66,9 @@ def db_update():
|
|||||||
# Обновление Задач
|
# Обновление Задач
|
||||||
logger.info(f"{Fore.YELLOW}Обновление Задач...\n{Fore.RESET}")
|
logger.info(f"{Fore.YELLOW}Обновление Задач...\n{Fore.RESET}")
|
||||||
|
|
||||||
db_tasks = db.get_tasks()
|
|
||||||
red_tasks = red.get_issues()
|
red_tasks = red.get_issues()
|
||||||
|
if red_tasks:
|
||||||
|
db_tasks = db.get_tasks()
|
||||||
clock_tasks = [task for task in red_tasks if task.id in [parse_task_id(tag.title) for tag in [*db_tags, *new_tags]]]
|
clock_tasks = [task for task in red_tasks if task.id in [parse_task_id(tag.title) for tag in [*db_tags, *new_tags]]]
|
||||||
new_tasks = [task for task in clock_tasks if task not in db_tasks]
|
new_tasks = [task for task in clock_tasks if task not in db_tasks]
|
||||||
|
|
||||||
@@ -82,6 +84,7 @@ def db_update():
|
|||||||
# Обновление Проектов Ветро
|
# Обновление Проектов Ветро
|
||||||
logger.info(f"{Fore.YELLOW}Обновление Проектов Ветро{Fore.RESET}")
|
logger.info(f"{Fore.YELLOW}Обновление Проектов Ветро{Fore.RESET}")
|
||||||
clock_projects = clock.get_vetro_projects()
|
clock_projects = clock.get_vetro_projects()
|
||||||
|
if clock_projects:
|
||||||
db_projects = db.get_vetro_projects()
|
db_projects = db.get_vetro_projects()
|
||||||
new_projects = [project for project in clock_projects if project not in db_projects]
|
new_projects = [project for project in clock_projects if project not in db_projects]
|
||||||
|
|
||||||
@@ -97,6 +100,7 @@ def db_update():
|
|||||||
# Обновление Типов деятельности
|
# Обновление Типов деятельности
|
||||||
logger.info(f"{Fore.YELLOW}Обновление Типов деятельности{Fore.RESET}")
|
logger.info(f"{Fore.YELLOW}Обновление Типов деятельности{Fore.RESET}")
|
||||||
red_types = red.get_time_entry_activities()
|
red_types = red.get_time_entry_activities()
|
||||||
|
if red_types:
|
||||||
db_types = db.get_activity_types()
|
db_types = db.get_activity_types()
|
||||||
new_types = [type_ for type_ in red_types if type_ not in db_types]
|
new_types = [type_ for type_ in red_types if type_ not in db_types]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user