Tutor local launch after install/enabling plugin

This issue is a duplicate from:

I simply created a new environment variable: BASE_DOMAIN=charite.local and a plugin to patch settings.

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_items(
    [    
        (
            "lms-env",
            """
"SESSION_COOKIE_DOMAIN": ".{{ BASE_DOMAIN }}"
"""
        ),
        (
            "cms-env",
            """
"SESSION_COOKIE_DOMAIN": ".{{ BASE_DOMAIN }}"
"""
        ),
        (
            "openedx-cms-production-settings",
            """
SESSION_COOKIE_DOMAIN: ".{{ BASE_DOMAIN }}"
"""
        ),
        (
            "openedx-lms-production-settings",
            """
SESSION_COOKIE_DOMAIN: ".{{ BASE_DOMAIN }}"
"""
        )
    ]
)

Patches append a new variable to the files, it doesn’t replace the old values which creates a duplicate. This seems unintuitive but the last key is always read so it works.