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.
2018-12-14 12:51:12 +00:00
|
|
|
"""passbook captcha factor forms"""
|
|
|
|
from captcha.fields import ReCaptchaField
|
|
|
|
from django import forms
|
|
|
|
|
2019-02-24 21:39:09 +00:00
|
|
|
from passbook.captcha_factor.models import CaptchaFactor
|
|
|
|
from passbook.core.forms.factors import GENERAL_FIELDS
|
|
|
|
|
2018-12-14 12:51:12 +00:00
|
|
|
|
|
|
|
class CaptchaForm(forms.Form):
|
|
|
|
"""passbook captcha factor form"""
|
|
|
|
|
|
|
|
captcha = ReCaptchaField()
|
2019-02-24 21:39:09 +00:00
|
|
|
|
|
|
|
class CaptchaFactorForm(forms.ModelForm):
|
|
|
|
"""Form to edit CaptchaFactor Instance"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = CaptchaFactor
|
|
|
|
fields = GENERAL_FIELDS + ['public_key', 'private_key']
|
|
|
|
widgets = {
|
|
|
|
'name': forms.TextInput(),
|
|
|
|
'order': forms.NumberInput(),
|
|
|
|
'public_key': forms.TextInput(),
|
|
|
|
'private_key': forms.TextInput(),
|
|
|
|
}
|