def send_instance_to_github()

in nucleus/base/models.py [0:0]


def send_instance_to_github(instance, branch=DEFAULT_BRANCH):
    log.debug(f"send_instance_to_github, {instance._meta.label_lower}, {instance.pk}")
    if not settings.GITHUB_PUSH_ENABLE:
        return

    author = get_current_user()
    ghl = GithubLog.objects.create(
        content_object=instance,
        author=author,
        branch=branch,
    )
    tasks.schedule("nucleus:save_to_github", ghl.pk)