from patch.include import *


@app_context(commit=True)
def patch():
    for project in models.CmfProject.list(
            filter=['AND', ['project_type', '=', 'home'], ['OR', ['show_disk', '!=', True], ['show_docs', '!=', True]]],
            fields=['show_disk', 'show_docs']):
        #
        print(f'Enable disk and docs for {project.code}')
        project.show_disk = True
        project.show_docs = True
        project.save()


if __name__ == "__main__":
    patch()
