1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-30 21:50:59 +00:00
seahub/thirdpart/termsandconditions/forms.py
2016-07-22 16:34:09 +08:00

27 lines
1.0 KiB
Python

"""Django forms for the termsandconditions application"""
# pylint: disable=E1120,W0613
from django import forms
from termsandconditions.models import UserTermsAndConditions, TermsAndConditions
class UserTermsAndConditionsModelForm(forms.ModelForm):
"""Form used when accepting Terms and Conditions - returnTo is used to catch where to end up."""
returnTo = forms.CharField(required=False, initial="/", widget=forms.HiddenInput())
class Meta(object):
"""Configuration for this Modelform"""
model = UserTermsAndConditions
exclude = ('date_accepted', 'ip_address', 'user')
widgets = {'terms': forms.HiddenInput()}
class EmailTermsForm(forms.Form):
"""Form used to collect email address to send terms and conditions to."""
email_subject = forms.CharField(widget=forms.HiddenInput())
email_address = forms.EmailField()
returnTo = forms.CharField(required=False, initial="/", widget=forms.HiddenInput())
terms = forms.ModelChoiceField(queryset=TermsAndConditions.objects.all(), widget=forms.HiddenInput())