INNER CODE UNIT · Python

get_current_captcha_cls

gnuboard/g6 · lib/captcha/__init__.py:6

def get_current_captcha_cls(config: Config):
    """캡챠 클래스를 반환하는 함수
    Args:
        config (Config) : config 모델
    Returns:
        Optional[class]: 캡차 클래스 or None
    """
    captcha_name = getattr(config, "cf_captcha", "")
    if captcha_name == "recaptcha":
        return ReCaptchaV2
    elif captcha_name == "recaptcha_inv":
        return ReCaptchaInvisible
    else:
        return None


def captcha_widget(request) -> str:
    """템플릿에서 캡차 출력

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…