This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2019-02-24 21:39:09 +00:00
|
|
|
"""passbook captcha factor"""
|
|
|
|
from django.db import models
|
2020-02-21 14:12:16 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2019-02-24 21:39:09 +00:00
|
|
|
|
|
|
|
from passbook.core.models import Factor
|
|
|
|
|
|
|
|
|
|
|
|
class CaptchaFactor(Factor):
|
|
|
|
"""Captcha Factor instance"""
|
|
|
|
|
2020-02-21 14:12:16 +00:00
|
|
|
public_key = models.TextField(
|
|
|
|
help_text=_(
|
|
|
|
"Public key, acquired from https://www.google.com/recaptcha/intro/v3.html"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
private_key = models.TextField(
|
|
|
|
help_text=_(
|
|
|
|
"Private key, acquired from https://www.google.com/recaptcha/intro/v3.html"
|
|
|
|
)
|
|
|
|
)
|
2019-02-24 21:39:09 +00:00
|
|
|
|
2019-12-31 11:51:16 +00:00
|
|
|
type = "passbook.factors.captcha.factor.CaptchaFactor"
|
|
|
|
form = "passbook.factors.captcha.forms.CaptchaFactorForm"
|
2019-02-24 21:39:09 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
2019-10-07 14:33:48 +00:00
|
|
|
return f"Captcha Factor {self.slug}"
|
2019-02-24 21:39:09 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
2019-12-31 11:51:16 +00:00
|
|
|
verbose_name = _("Captcha Factor")
|
|
|
|
verbose_name_plural = _("Captcha Factors")
|