savannah-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 7


From: Jonathan Gonzalez V.
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 7de299df3ddfbec710aed9eee04b4b64ba3ae836
Date: Tue, 29 Sep 2009 19:47:01 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Savane-cleanup framework".

The branch, master has been updated
       via  7de299df3ddfbec710aed9eee04b4b64ba3ae836 (commit)
       via  23c8f79c0829b5e6088ca8a5fc4ccc17247d6f0b (commit)
       via  bae6cfe24a185da2845ca12f50a388570392759b (commit)
      from  cade4791a8109e106e84c8b60a044b1c63ca59b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=7de299df3ddfbec710aed9eee04b4b64ba3ae836

commit 7de299df3ddfbec710aed9eee04b4b64ba3ae836
Author: Jonathan Gonzalez V <address@hidden>
Date:   Tue Sep 29 15:33:37 2009 -0400

    Initial files for the register app

diff --git a/src/savane/register/__init__.py b/src/savane/register/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/savane/register/urls.py b/src/savane/register/urls.py
new file mode 100644
index 0000000..bca2e1c
--- /dev/null
+++ b/src/savane/register/urls.py
@@ -0,0 +1,24 @@
+# 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)
+)
diff --git a/src/savane/register/views.py b/src/savane/register/views.py
new file mode 100644
index 0000000..bcf53b2
--- /dev/null
+++ b/src/savane/register/views.py
@@ -0,0 +1,67 @@
+# 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
diff --git a/src/settings.py b/src/settings.py
index 3d8c010..23c0867 100644
--- a/src/settings.py
+++ b/src/settings.py
@@ -93,6 +93,7 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     'savane.svmain',
     'savane.my',
+    'savane.register',
 # Disabled: we're not using it currently, and there are issues with
 # login when no site is defined
 #    'django.contrib.sites',
diff --git a/src/urls.py b/src/urls.py
index b228499..122b986 100644
--- a/src/urls.py
+++ b/src/urls.py
@@ -34,6 +34,11 @@ urlpatterns += patterns('',
   (r'^accounts/', include('django.contrib.auth.urls')),
 )
 
+# Registration
+urlpatterns += patterns('',
+  (r'^register/', include('savane.register.urls')),
+)
+
 # Enable the auto-admin:
 from django.contrib import admin
 import django
diff --git a/template/register/register.html b/template/register/register.html
new file mode 100644
index 0000000..0c72fd3
--- /dev/null
+++ b/template/register/register.html
@@ -0,0 +1,25 @@
+{% extends "base.html" %}
+
+{% block content %}
+<form action="{% url savane.register.views.register %}" method="post">
+<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 %}
diff --git a/template/registration/README b/template/registration/README
deleted file mode 100644
index f6757e6..0000000
--- a/template/registration/README
+++ /dev/null
@@ -1,3 +0,0 @@
-'registration/login.html' is the place where Django (more precisely
-'django.contrib.auth.views.login') looks for the login template by
-default.
diff --git a/template/registration/login.html b/template/registration/login.html
deleted file mode 100644
index e5ca5a4..0000000
--- a/template/registration/login.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{# -*- Mode: django-html; -*- #}
-{% extends "base.html" %}
-
-{% block content %}
-Login:
-
-<form action="{% url django.contrib.auth.views.login %}" method="post">
-{{form.as_p}}
-<input type="submit" name="login" value="Login" />
-</table>
-</form>
-
-{% endblock %}

http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=23c8f79c0829b5e6088ca8a5fc4ccc17247d6f0b

commit 23c8f79c0829b5e6088ca8a5fc4ccc17247d6f0b
Author: Jonathan Gonzalez V <address@hidden>
Date:   Tue Sep 29 12:14:17 2009 -0400

    Removed unnecessary imports

diff --git a/src/savane/my/views.py b/src/savane/my/views.py
index c4df4ee..071552d 100644
--- a/src/savane/my/views.py
+++ b/src/savane/my/views.py
@@ -26,12 +26,6 @@ from django import forms
 from savane.svmain.models import ExtendedUser, SshKey
 from savane.utils import *
 
-import random
-import time
-import os
-import re
-from subprocess import Popen, PIPE
-
 @login_required()
 def sv_conf( request ):
 

http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=bae6cfe24a185da2845ca12f50a388570392759b

commit bae6cfe24a185da2845ca12f50a388570392759b
Author: Jonathan Gonzalez V <address@hidden>
Date:   Tue Sep 29 12:14:05 2009 -0400

    Removed repeated line

diff --git a/src/savane/my/urls.py b/src/savane/my/urls.py
index 9fd2182..cf5f88b 100644
--- a/src/savane/my/urls.py
+++ b/src/savane/my/urls.py
@@ -59,7 +59,6 @@ urlpatterns = decorated_patterns ('', login_required,
   url('^conf/$', views.sv_conf),
   url('^conf/resume_skill$', views.sv_resume_skill),
   url('^conf/ssh_gpg$', views.sv_ssh_gpg),
-  url('^conf/ssh_gpg$', views.sv_ssh_gpg),
   url(r'^groups/$', only_mine(object_list),
       { 'queryset' : svmain_models.ExtendedGroup.objects.all() },
       name='savane.my.group_list'),

-----------------------------------------------------------------------

Summary of changes:
 src/savane/my/urls.py                              |    1 -
 src/savane/my/views.py                             |    6 --
 src/{ => savane/register}/__init__.py              |    0
 .../{context_processors.py => register/urls.py}    |   24 +++----
 src/savane/register/views.py                       |   67 ++++++++++++++++++++
 src/settings.py                                    |    1 +
 src/urls.py                                        |    5 ++
 template/register/register.html                    |   25 +++++++
 template/registration/README                       |    3 -
 template/registration/login.html                   |   13 ----
 10 files changed, 108 insertions(+), 37 deletions(-)
 copy src/{ => savane/register}/__init__.py (100%)
 copy src/savane/{context_processors.py => register/urls.py} (66%)
 create mode 100644 src/savane/register/views.py
 create mode 100644 template/register/register.html
 delete mode 100644 template/registration/README
 delete mode 100644 template/registration/login.html


hooks/post-receive
-- 
Savane-cleanup framework




reply via email to

[Prev in Thread] Current Thread [Next in Thread]