Mercurial > hg > savane-forge
changeset 171:95cf3d737dbf
Remove draft for custom registration
author | Sylvain Beucler <beuc@beuc.net> |
---|---|
date | Thu, 22 Jul 2010 21:26:25 +0200 |
parents | 3ddd86437b55 |
children | fa5346d25dfc |
files | savane/register/__init__.py savane/register/urls.py savane/register/views.py templates/register/register.html urls.py |
diffstat | 5 files changed, 0 insertions(+), 121 deletions(-) [+] |
line wrap: on
line diff
deleted file mode 100644 --- a/savane/register/urls.py +++ /dev/null @@ -1,24 +0,0 @@ -# URL dispatching -# Copyright (C) 2009 Jonathan Gonzalez V. -# -# This file is part of Savane. -# -# Savane is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Savane is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -from django.conf.urls.defaults import * -import views - -urlpatterns = patterns ('', - (r'^$', views.register) -)
deleted file mode 100644 --- a/savane/register/views.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2009 Jonathan Gonzalez V. -# -# This file is part of Savane. -# -# Savane is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Savane is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -from django.template import RequestContext -from django.shortcuts import render_to_response -from django import forms - -from savane.svmain.models import ExtendedUser, SshKey - - -def register( request ): - error_msg = '' - success_msg = '' - - form = RegisterForm() - - return render_to_response('register/register.html', - { 'error_msg' : error_msg, - 'form' : form, - 'success_msg' : success_msg, - }, - context_instance=RequestContext(request)) - - - -class RegisterForm( forms.Form ): - username = forms.CharField( required=True ) - password = forms.CharField( widget=forms.PasswordInput,required=True ) - repeat_password = forms.CharField( widget=forms.PasswordInput,required=True ) - first_name = forms.CharField() - last_name = forms.CharField() - email = forms.EmailField( required=True ) - - action = forms.CharField( widget=forms.HiddenInput, required=True, initial='register' ) - - def clean_login( self ): - username = lsef.cleaned_data['username'] - - try: - user = ExtendedUser.objects.get( username=username) - except: - return username - - raise forms.ValidationError( 'The username already exists.' ) - - def clean( self ): - password = self.cleaned_data.get( 'password' ) - repeat_password = self.cleaned_data.get( 'repeat_password' ) - - if password != repeat_password: - raise forms.ValidationError( 'Password do not match.' ) - - return self.cleaned_data
deleted file mode 100644 --- a/templates/register/register.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -<form action="{% url savane.register.views.register %}" method="post">{% csrf_token %} -<dl> - {% for field in form %} - {% if field.is_hidden %} - {{field}} - {% else %} - <dt>{{ field.label_tag }} {{ field.errors }}</dt> - <dd>{{ field }}</dd> - {% endif %} - {% endfor %} -<input type="submit" name="Register" value="Register" /> -</table> -</form> -{% endblock %} - -{% comment %} -Local Variables: ** -mode: django-html ** -tab-width: 4 ** -indent-tabs-mode: nil ** -End: ** -{% endcomment %}