Skip to content

Wrong responses when Listmonk uses different languages #23

@erykksc

Description

@erykksc

I've been getting false return statuses because of the hard coded Listmonk responses.

When I've been using method 'confirm_optin' I've been getting false results. The return value was False, as if Listmonk didn't confirm a user.
When I check the listmonk admin dashboard I can see that the user is confirmed and the method call has worked.

After a bit of investigation I've found the problematic part, the return values are hardcoded in english. My language of Listmonk is different and thus I've been getting wrong results.

    success_phrases = {
        # New conformation was created now.
        'Subscribed successfully.',
        'Confirmed',
        # They were already confirmed somehow previously.
        'no subscriptions to confirm',
        'No subscriptions',
    }

    text = resp.text or ''
    return any(p in text for p in success_phrases)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions