hasgeek / funnel

if statements can be merged PTC-W0048
Anti-pattern
Major
3 occurrences in this check
Consider merging collapsible if statements
360        return render_redirect(url_for('account'))
361
362    # If there is a next destination, is it in the same domain as the client?
363    if 'next' in request.args:364        if not auth_client.host_matches(request.args['next']):
365            # Host doesn't match. Assume CSRF and redirect to account without logout
366            flash(LOGOUT_ERRORMSG, 'danger')
Consider merging collapsible if statements
292def autoset_timezone_and_locale() -> None:
293    """Set the current user's timezone and locale automatically if required."""
294    user = current_auth.user
295    if (296        user.auto_timezone
297        or not user.timezone
298        or str(user.timezone).lower() not in valid_timezones
Consider merging collapsible if statements
926    old_value: EmailAddress | None,
927    _initiator: Any,
928) -> None:
929    if value != old_value and target.__email_for__:930        if value is not None:
931            if value.is_blocked:
932                raise EmailAddressBlockedError("This email address has been blocked")