All auth form with extra fields added, setings tweaked

This commit is contained in:
unknown 2012-07-17 16:23:04 +02:00
parent edc6f63cd9
commit bb89200e8b
2 changed files with 29 additions and 11 deletions

View File

@ -35,6 +35,16 @@ class ConnectionsWidget(forms.SelectMultiple):
#ctx['data_json'] = json.dumps(selected_values) # json.dumps(choices)
return ctx
class ItfAllAuthRegForm(forms.Form):
firstname=forms.CharField()
lastname=forms.CharField()
def save(self, user):
first_name = self.cleaned_data['firstname']
last_name = self.cleaned_data['lastname']
p = Person(user=user, first_name=first_name, last_name=last_name)
p.save()
return self
class ItfRegistrationForm(RegistrationForm):
subscribe = forms.BooleanField(help_text='Subscribe to newsletter?')

View File

@ -228,28 +228,36 @@ INSTALLED_APPS = (
'emailconfirmation',
)
LOGIN_REDIRECT_URL = '/'
LOGIN_REDIRECT_URL = '/itf_profile'
#ACCOUNT_AUTHENTICATION_METHOD=''
#ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_EMAIL_REQUIRED=False
ACCOUNT_EMAIL_REQUIRED=True
ACCOUNT_EMAIL_VERIFICATION=False
ACCOUNT_EMAIL_SUBJECT_PREFIX="[ITF]"
ACCOUNT_SIGNUP_PASSWORD_VERIFICATION=True
ACCOUNT_SIGNUP_FORM_CLASS='itfprofiles.forms.ItfAllAuthRegForm'
ACCOUNT_UNIQUE_EMAIL=False
ACCOUNT_PASSWORD_MIN_LENGTH=6
# TODO ACCOUNT_USER_DISPLAY (=a callable returning user.username)
ACCOUNT_PASSWORD_MIN_LENGTH=4
SOCIALACCOUNT_AVATAR_SUPPORT='avatar'
#SOCIALACCOUNT_QUERY_EMAIL=True
EMAIL_CONFIRMATION_DAYS=3
# check if the below setting allows confirmation of username retrieved from social site
SOCIALACCOUNT_AUTO_SIGNUP=False
#EMAIL_HOST ='smtp.gmail.com'
#EMAIL_HOST_USER = 'subhodipbiswas@gmail.com'
#EMAIL_HOST_PASSWORD ='doaxhentai'
#EMAIL_PORT =587
#EMAIL_USE_TLS =True
#SERVER_EMAIL = EMAIL_HOST_USER
#DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
# Nice to have but needs checking
#SOCIALACCOUNT_PROVIDERS (= dict)
SOCIALACCOUNT_PROVIDERS = { 'openid':
{ 'SERVERS':
[dict(id='yahoo',
name='Yahoo',
openid_url='http://me.yahoo.com'),
dict(id='google',
name='Google',
openid_url='https://www.google.com/accounts/o8/id')]}}
ACCOUNT_ACTIVATION_DAYS = 30
#ACCOUNT_ACTIVATION_DAYS = 30
#overwrite default settings with local settings
try: