##// END OF EJS Templates
users: add edition of description in admin view for users
marcink -
r4022:8d4c4139 default
parent child Browse files
Show More
@@ -599,6 +599,7 b' class MyAccountView(BaseAppView, DataGri'
599 'email': c.user.email,
599 'email': c.user.email,
600 'firstname': c.user.firstname,
600 'firstname': c.user.firstname,
601 'lastname': c.user.lastname,
601 'lastname': c.user.lastname,
602 'description': c.user.description,
602 }
603 }
603 c.form = forms.RcForm(
604 c.form = forms.RcForm(
604 schema, appstruct=appstruct,
605 schema, appstruct=appstruct,
@@ -143,6 +143,7 b' def UserForm(localizer, edit=False, avai'
143 firstname = v.UnicodeString(strip=True, min=1, not_empty=False)
143 firstname = v.UnicodeString(strip=True, min=1, not_empty=False)
144 lastname = v.UnicodeString(strip=True, min=1, not_empty=False)
144 lastname = v.UnicodeString(strip=True, min=1, not_empty=False)
145 email = All(v.UniqSystemEmail(localizer, old_data), v.Email(not_empty=True))
145 email = All(v.UniqSystemEmail(localizer, old_data), v.Email(not_empty=True))
146 description = v.UnicodeString(strip=True, min=1, max=250, not_empty=False)
146 extern_name = v.UnicodeString(strip=True)
147 extern_name = v.UnicodeString(strip=True)
147 extern_type = v.UnicodeString(strip=True)
148 extern_type = v.UnicodeString(strip=True)
148 language = v.OneOf(available_languages, hideList=False,
149 language = v.OneOf(available_languages, hideList=False,
@@ -179,6 +179,7 b' class UserModel(BaseModel):'
179 'email': user.email,
179 'email': user.email,
180 'firstname': user.name,
180 'firstname': user.name,
181 'lastname': user.lastname,
181 'lastname': user.lastname,
182 'description': user.description,
182 'active': user.active,
183 'active': user.active,
183 'admin': user.admin,
184 'admin': user.admin,
184 'extern_name': user.extern_name,
185 'extern_name': user.extern_name,
@@ -225,7 +226,8 b' class UserModel(BaseModel):'
225 active=True, admin=False, extern_type=None, extern_name=None,
226 active=True, admin=False, extern_type=None, extern_name=None,
226 cur_user=None, plugin=None, force_password_change=False,
227 cur_user=None, plugin=None, force_password_change=False,
227 allow_to_create_user=True, create_repo_group=None,
228 allow_to_create_user=True, create_repo_group=None,
228 updating_user_id=None, language=None, strict_creation_check=True):
229 updating_user_id=None, language=None, description=None,
230 strict_creation_check=True):
229 """
231 """
230 Creates a new instance if not found, or updates current one
232 Creates a new instance if not found, or updates current one
231
233
@@ -356,6 +358,7 b' class UserModel(BaseModel):'
356 new_user.extern_type = safe_unicode(extern_type)
358 new_user.extern_type = safe_unicode(extern_type)
357 new_user.name = firstname
359 new_user.name = firstname
358 new_user.lastname = lastname
360 new_user.lastname = lastname
361 new_user.description = description
359
362
360 # set password only if creating an user or password is changed
363 # set password only if creating an user or password is changed
361 if not edit or _password_change(new_user, password):
364 if not edit or _password_change(new_user, password):
@@ -167,6 +167,12 b' class UserProfileSchema(colander.Schema)'
167 lastname = colander.SchemaNode(
167 lastname = colander.SchemaNode(
168 colander.String(), missing='', title='Last name')
168 colander.String(), missing='', title='Last name')
169
169
170 description = colander.SchemaNode(
171 colander.String(), missing='', title='Personal Description',
172 widget=forms.widget.TextAreaWidget(),
173 validator=colander.Length(max=250)
174 )
175
170 email = colander.SchemaNode(
176 email = colander.SchemaNode(
171 colander.String(), widget=deferred_user_email_in_emails_widget,
177 colander.String(), widget=deferred_user_email_in_emails_widget,
172 validator=deferred_user_email_in_emails_validator,
178 validator=deferred_user_email_in_emails_validator,
@@ -176,6 +182,7 b' class UserProfileSchema(colander.Schema)'
176 )
182 )
177
183
178
184
185
179 class AddEmailSchema(colander.Schema):
186 class AddEmailSchema(colander.Schema):
180 current_password = colander.SchemaNode(
187 current_password = colander.SchemaNode(
181 colander.String(),
188 colander.String(),
@@ -68,6 +68,14 b''
68 </div>
68 </div>
69 <div class="field">
69 <div class="field">
70 <div class="label">
70 <div class="label">
71 <label for="description">${_('Description')}:</label>
72 </div>
73 <div class="input textarea editor">
74 ${h.textarea('description', class_="medium")}
75 </div>
76 </div>
77 <div class="field">
78 <div class="label">
71 ${_('New Password')}:
79 ${_('New Password')}:
72 </div>
80 </div>
73 <div class="input">
81 <div class="input">
General Comments 0
You need to be logged in to leave comments. Login now