fix inconsistent naming

This commit is contained in:
Jens Langhammer
2019-02-16 10:59:23 +01:00
parent 89722336e3
commit 744a320731
5 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1,25 @@
"""passbook administration forms"""
from django import forms
from passbook.core.auth.factor_manager import MANAGER
from passbook.core.models import Factor
from passbook.lib.utils.reflection import class_to_path
def get_factors():
"""Return list of factors for Select Widget"""
for factor in MANAGER.all:
yield (class_to_path(factor), factor.__name__)
class FactorForm(forms.ModelForm):
"""Form to create/edit Factors"""
class Meta:
model = Factor
fields = ['name', 'slug', 'order', 'policies', 'type', 'enabled']
widgets = {
'type': forms.Select(choices=get_factors()),
'name': forms.TextInput(),
'order': forms.NumberInput(),
}