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. 6


From: Jonathan Gonzalez V.
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 6a3773599bba85cb9f2e4e44a570678173fcb4cd
Date: Wed, 24 Jun 2009 18:54:55 +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  6a3773599bba85cb9f2e4e44a570678173fcb4cd (commit)
      from  75431b650d8304e4b5604be5e0b2081f44f5a9ed (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=6a3773599bba85cb9f2e4e44a570678173fcb4cd

commit 6a3773599bba85cb9f2e4e44a570678173fcb4cd
Author: Jonathan Gonzalez V <address@hidden(none)>
Date:   Wed Jun 24 14:51:59 2009 -0400

    Added default values to the ssh/gpg forms, so the user will see what did he 
set.

diff --git a/savane/savane_user/views.py b/savane/savane_user/views.py
index f76437e..fe295ef 100644
--- a/savane/savane_user/views.py
+++ b/savane/savane_user/views.py
@@ -94,11 +94,11 @@ def sv_ssh_gpg( request ):
     error_msg = None
     success_msg = None
 
-    form_gpg = GPGForm()
     form_ssh = SSHForm()
-    form = None
+    form_gpg = GPGForm()
 
     if request.method == 'POST':
+        form = None
         action = request.POST['action']
         if action == 'update_ssh':
             form_ssh = SSHForm( request.POST )
@@ -122,15 +122,24 @@ def sv_ssh_gpg( request ):
             elif action == 'update_gpg':
                 pass
     else:
-        keys_data = dict({'action':'update_ssh'})
-        keys = request.user.authorized_keys.split('###')
-        i = 1
-        for key in keys:
-            key_str = 'key_'+str(i)
-            keys_data[ key_str ] = key
-            i += 1
-
-        form_ssh = SSHForm( keys_data )
+        if request.user.authorized_keys != '':
+            keys_data = dict({'action':'update_ssh'})
+            keys = request.user.authorized_keys.split('###')
+            i = 1
+            for key in keys:
+                key_str = 'key_'+str(i)
+                keys_data[ key_str ] = key
+                i += 1
+                form_ssh = SSHForm( keys_data )
+        else:
+            form_ssh = SSHForm()
+
+        if request.user.gpg_key != '':
+            gpg_data = dict({'action':'update_gpg', 
'gpg_key':request.user.gpg_key})
+            form_gpg = GPGForm( gpg_data )
+        else:
+            form_gpg = GPGForm()
+
 
     return render_to_response( 'savane_user/ssh_gpg.html',
                                RequestContext( request,

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

Summary of changes:
 savane/savane_user/views.py |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Savane-cleanup framework




reply via email to

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