Browse Source

allow to set user name which will be visible in the interface

Damien Accorsi 10 years ago
parent
commit
98e5bbfa9b
2 changed files with 3 additions and 2 deletions
  1. 2 2
      pboard/pboard/controllers/apipublic.py
  2. 1 0
      pboard/pboard/templates/pod.mak

+ 2 - 2
pboard/pboard/controllers/apipublic.py View File

@@ -15,7 +15,7 @@ from tg.i18n import ugettext as _
15 15
 class PODPublicApiController(plb.BaseController):
16 16
 
17 17
     @tg.expose()
18
-    def create_account(self, email='', password='', retyped_password='', **kw):
18
+    def create_account(self, email='', password='', retyped_password='', real_name='', **kw):
19 19
       if email=='' or password=='' or retyped_password=='':
20 20
         tg.flash(_('Account creation error: please fill all the fields'), 'error')
21 21
         tg.redirect(tg.lurl('/'))
@@ -30,7 +30,7 @@ class PODPublicApiController(plb.BaseController):
30 30
 
31 31
         loNewAccount = pld.PODStaticController.createUser()
32 32
         loNewAccount.email_address = email
33
-        loNewAccount.display_name  = email
33
+        loNewAccount.display_name  = real_name if real_name!='' else email
34 34
         loNewAccount.password      = password
35 35
 
36 36
         loUserGroup = pld.PODStaticController.getGroup('user')

+ 1 - 0
pboard/pboard/templates/pod.mak View File

@@ -81,6 +81,7 @@
81 81
     <form class="well" method="POST" style="min-height: ${psCssMinHeight};" action="${tg.url('/public_api/create_account')}">
82 82
       <fieldset>
83 83
         <legend>${_('Create an account')}</legend>
84
+        <input type="text"     name="real_name"        id="real_name" placeholder="Name"><br/>
84 85
         <input type="text"     name="email"            id="email" placeholder="Email"><br/>
85 86
         <input type="password" name="password"         id="password" placeholder="Password"><br/>
86 87
         <input type="password" name="retyped_password" id="retyped_password" placeholder="Retype your password"><br/>