Пример #1
0
def delete_component(sender, instance, **kwargs):
    """Handler to delete (sub)project directory on project deletion."""
    from weblate.trans.tasks import cleanup_project
    cleanup_project.delay(instance.project.pk)

    # Do not delete linked components
    if not instance.is_repo_link:
        delete_object_dir(sender, instance, **kwargs)
Пример #2
0
def component_post_delete(sender, instance, **kwargs):
    """Handler to delete (sub)project directory on project deletion."""
    # Invalidate stats
    instance.stats.invalidate()

    # Schedule project cleanup
    from weblate.trans.tasks import cleanup_project
    cleanup_project.delay(instance.project.pk)

    # Do not delete linked components
    if not instance.is_repo_link:
        delete_object_dir(instance)
Пример #3
0
def component_post_delete(sender, instance, **kwargs):
    """Handler to delete (sub)project directory on project deletion."""
    # Invalidate stats
    instance.stats.invalidate()

    # Schedule project cleanup
    from weblate.trans.tasks import cleanup_project
    cleanup_project.delay(instance.project.pk)

    # Do not delete linked components
    if not instance.is_repo_link:
        delete_object_dir(instance)