# HG changeset patch # User nishanth # Date 1270808327 -19800 # Node ID af9ab5ad2786e05fd1c658dfa636ea8d082f0902 # Parent 057498d1245022a7948f2bcdeed0db7c346efc0e fixed a bug in registration . diff -r 057498d12450 -r af9ab5ad2786 account_created.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/account_created.html Fri Apr 09 15:48:47 2010 +0530 @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block content %} +The account has been created.
+click here to go to login page. +{% endblock %} diff -r 057498d12450 -r af9ab5ad2786 base.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/base.html Fri Apr 09 15:48:47 2010 +0530 @@ -0,0 +1,12 @@ + + + +{% block title %} +Workshop App +{% endblock %} + + +{% block content %} +{% endblock %} + + diff -r 057498d12450 -r af9ab5ad2786 reg/events.py --- a/reg/events.py Fri Apr 09 15:35:40 2010 +0530 +++ b/reg/events.py Fri Apr 09 15:48:47 2010 +0530 @@ -57,7 +57,12 @@ return new_event except IntegrityError: pass -''' -def mail_user(email): - """ get the user -''' + + +def activate_user(user): + """ mark the is_active flag as true. + """ + + user.is_active = True + user.save() + return user diff -r 057498d12450 -r af9ab5ad2786 reg/forms.py --- a/reg/forms.py Fri Apr 09 15:35:40 2010 +0530 +++ b/reg/forms.py Fri Apr 09 15:48:47 2010 +0530 @@ -1,8 +1,7 @@ import string +from django import forms from django.contrib.auth.models import User -from django import forms - from django.contrib.auth import authenticate from workshop.reg.models import Profile @@ -47,6 +46,9 @@ fields = ['email', 'password', 'confirm_password', 'first_name', 'last_name', 'gender', 'profession', 'affiliated_to', 'interests'] def clean_email(self): + """ check if a user exists with same email. + """ + email = self.cleaned_data['email'] try: User.objects.get(email__iexact=email) @@ -56,6 +58,11 @@ return email def clean_password(self): + """ check if the password contains only alphabets or digits or punctuation. + then check if the size of the password is optimal. + then check if both the given passwords match. + """ + password = self.cleaned_data['password'] if password.strip(string.ascii_letters+string.punctuation+string.digits): diff -r 057498d12450 -r af9ab5ad2786 register.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/register.html Fri Apr 09 15:48:47 2010 +0530 @@ -0,0 +1,7 @@ +{% extends "base.html" %} +{% block content %} +
+{{ form.as_p }} + +
+{% endblock %}