Skip to content

Add missing 'message' placeholder in 2FA key invalid error handling #3185

@coderabbitai

Description

@coderabbitai

Description

The description_placeholders dictionary is missing the message key in multiple locations where 2FA key invalid errors are raised. Some translation files (e.g., en.json, bg.json, sv.json) define the 2fa_key_invalid error as "{otp_secret} is invalid.\n{message}" which expects both otp_secret and message placeholders. This will cause a KeyError or rendering issue for those languages.

Suggested Fix

Add "message": "" to the description_placeholders dictionary to maintain compatibility with all translations.

Locations (3 occurrences)

  • File: custom_components/alexa_media/config_flow.py
  • Multiple locations where 2fa_key_invalid error is raised with description_placeholders

Example Fix

description_placeholders={
    "otp_secret": self.config.get(CONF_OTPSECRET, ""),
    "message": "",
}

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions