fix: Reg upload public key: db private key can't be null
authorYasin <mohammed-yasin.rahman@lip6.fr>
Thu, 17 Jul 2014 16:10:24 +0000 (18:10 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Thu, 17 Jul 2014 16:10:24 +0000 (18:10 +0200)
portal/registrationview.py

index 7967a91..f6d0291 100644 (file)
@@ -142,8 +142,8 @@ class RegistrationView (FreeAccessView, ThemeView):
                 ALLOWED_EXTENSIONS =  ['.pub','.txt']
                 if file_extension not in ALLOWED_EXTENSIONS or not re.search(r'ssh-rsa',file_content):
                     errors.append('Please upload a valid RSA public key.')
-
-                user_request['private_key'] = None
+                # user_request['private_key'] can't be Null because all db fields are set as NOT NULL
+                user_request['private_key'] = ""
                 user_request['public_key']  = file_content
                 
             if not errors: