from patch.include import *
from tqdm import tqdm
from cmf.system_data import scaffold_event_type, scaffold_project_notify_scheme, init_system_users

@app_context(commit=True)
def newnotifyscheme():
    """
    Для тестирования патча: ( cd /opt/eva-app; python3 -m patch.202310041721_newnotifyscheme )
    Здесь можно работать с моделями через models.CmfTask и т.д.
    Для прогрессбара используйте:
    for task in tqdm(models.CmfTask.list()):
        ...
    """
    print('Запуск патча newnotifyscheme')
    with cmfutil.disable_acl(), cmfutil.disable_notify():
        init_system_users()
        scaffold_event_type()
        scaffold_project_notify_scheme()


if __name__ == "__main__":
    newnotifyscheme()
