Repository: wagtail/wagtail
File: wagtail/admin/widgets/tags.py (Python)

Code before:
    def get_context(self, name, value, attrs):
        context = super().get_context(name, value, attrs)

        if self.tag_model == Tag:
            autocomplete_url = reverse("wagtailadmin_tag_autocomplete")
        else:
            autocomplete_url = reverse(
                "wagtailadmin_tag_model_autocomplete",
                args=(self.tag_model._meta.app_label, self.tag_model._meta.model_name),
            )

        if self.free_tagging is None:
            free_tagging = getattr(self.tag_model, "free_tagging", True)
        else:
            free_tagging = self.free_tagging

        if hasattr(settings, "TAG_SPACES_ALLOWED"):
            warn(
                "The setting 'TAG_SPACES_ALLOWED' is deprecated. "
                "Please use 'WAGTAIL_TAG_SPACES_ALLOWED' instead.",
                RemovedInWagtail70Warning,
            )

        tag_spaces_allowed = getattr(
            settings,
            "WAGTAIL_TAG_SPACES_ALLOWED",  # Make sure this matches your override setting name
            getattr(settings, "TAG_SPACES_ALLOWED", True),  # Fallback to old setting
        )

        if tag_spaces_allowed:
            help_text = _(
                'Multi-word tags with spaces will automatically be enclosed in double quotes (").'
            )
        else:
            help_text = _("Tags can only consist of a single word, no spaces allowed.")

        if hasattr(settings, "TAG_LIMIT"):
            warn(
                "The setting 'TAG_LIMIT' is deprecated. "
                "Please use 'WAGTAIL_TAG_LIMIT' instead.",
                RemovedInWagtail70Warning,
            )
        # Handle TAG_LIMIT with backward compatibility
        tag_limit = getattr(
            settings, "WAGTAIL_TAG_LIMIT", getattr(settings, "TAG_LIMIT", None)
        )

        context["widget"]["help_text"] = help_text
        context["widget"]["attrs"]["data-w-tag-delay-value"] = 200
        context["widget"]["attrs"]["data-w-tag-url-value"] = autocomplete_url
        context["widget"]["attrs"]["data-w-tag-options-value"] = json.dumps(

Review comment (suggestion):
This comment doesn't seem to provide any value

```suggestion
            "WAGTAIL_TAG_SPACES_ALLOWED",
```

Code after:
    def get_context(self, name, value, attrs):
        context = super().get_context(name, value, attrs)

        if self.tag_model == Tag:
            autocomplete_url = reverse("wagtailadmin_tag_autocomplete")
        else:
            autocomplete_url = reverse(
                "wagtailadmin_tag_model_autocomplete",
                args=(self.tag_model._meta.app_label, self.tag_model._meta.model_name),
            )

        if self.free_tagging is None:
            free_tagging = getattr(self.tag_model, "free_tagging", True)
        else:
            free_tagging = self.free_tagging

        if hasattr(settings, "TAG_SPACES_ALLOWED"):
            warn(
                "The setting 'TAG_SPACES_ALLOWED' is deprecated. "
                "Please use 'WAGTAIL_TAG_SPACES_ALLOWED' instead.",
                RemovedInWagtail70Warning,
            )
        tag_spaces_allowed = getattr(
            settings,
            "WAGTAIL_TAG_SPACES_ALLOWED",
            # RemovedInWagtail70Warning: Remove fallback to deprecated setting
            getattr(settings, "TAG_SPACES_ALLOWED", True),
        )

        if tag_spaces_allowed:
            help_text = _(
                'Multi-word tags with spaces will automatically be enclosed in double quotes (").'
            )
        else:
            help_text = _("Tags can only consist of a single word, no spaces allowed.")

        if hasattr(settings, "TAG_LIMIT"):
            warn(
                "The setting 'TAG_LIMIT' is deprecated. "
                "Please use 'WAGTAIL_TAG_LIMIT' instead.",
                RemovedInWagtail70Warning,
            )
        tag_limit = getattr(
            settings,
            "WAGTAIL_TAG_LIMIT",
            # RemovedInWagtail70Warning: Remove fallback to deprecated setting
            getattr(settings, "TAG_LIMIT", None),
        )

        context["widget"]["help_text"] = help_text
        context["widget"]["attrs"]["data-w-tag-delay-value"] = 200