21 lines
No EOL
640 B
Python
21 lines
No EOL
640 B
Python
from django import forms
|
|
from django.contrib.auth import authenticate, get_user_model
|
|
from django.contrib.auth.forms import UsernameField
|
|
from django.core.exceptions import ValidationError
|
|
from django.utils.text import capfirst
|
|
from django.utils.translation import gettext_lazy as _
|
|
from .models import OAuthCode
|
|
|
|
UserModel = get_user_model()
|
|
|
|
|
|
class OAUTHLoginRequestForm(forms.ModelForm):
|
|
"""
|
|
Base class for authenticating users. Extend this to get a form that accepts
|
|
username/password logins.
|
|
"""
|
|
agreement = forms.BooleanField(required=True)
|
|
|
|
class Meta:
|
|
model = OAuthCode
|
|
fields = ['agreement'] |