~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to mainpage/forms.py

  • Committer: kaputtnik
  • Date: 2019-05-30 18:20:02 UTC
  • mto: This revision was merged to the branch mainline in revision 540.
  • Revision ID: kaputtnik-20190530182002-g7l91m1xo28clghv
adjusted README; first commit on the new server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python -tt
2
2
# encoding: utf-8
3
3
 
4
 
from registration.forms import RegistrationForm
5
 
from wlrecaptcha.forms import RecaptchaForm, \
6
 
    RecaptchaFieldPlaceholder, RecaptchaWidget
7
 
 
8
 
class RegistrationWithCaptchaForm(RegistrationForm,RecaptchaForm):
9
 
    captcha = RecaptchaFieldPlaceholder(widget=RecaptchaWidget(theme="white"),
10
 
                                label="Are you human?")
11
 
 
12
 
 
 
4
from django import forms
 
5
from django_registration.forms import RegistrationForm
 
6
from nocaptcha_recaptcha.fields import NoReCaptchaField
 
7
from wlprofile.models import Profile as wlprofile
 
8
 
 
9
# Overwritten form to include a captcha
 
10
 
 
11
 
 
12
class RegistrationWithCaptchaForm(RegistrationForm):
 
13
    captcha = NoReCaptchaField()
 
14
 
 
15
 
 
16
class ContactForm(forms.Form):
 
17
    surname = forms.CharField(max_length=80, required=False)
 
18
    forename = forms.CharField(max_length=80, required=False)
 
19
    email = forms.EmailField()
 
20
    inquiry = forms.CharField(widget=forms.Textarea)