##// 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 599 'email': c.user.email,
600 600 'firstname': c.user.firstname,
601 601 'lastname': c.user.lastname,
602 'description': c.user.description,
602 603 }
603 604 c.form = forms.RcForm(
604 605 schema, appstruct=appstruct,
@@ -143,6 +143,7 b' def UserForm(localizer, edit=False, avai'
143 143 firstname = v.UnicodeString(strip=True, min=1, not_empty=False)
144 144 lastname = v.UnicodeString(strip=True, min=1, not_empty=False)
145 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 147 extern_name = v.UnicodeString(strip=True)
147 148 extern_type = v.UnicodeString(strip=True)
148 149 language = v.OneOf(available_languages, hideList=False,
@@ -179,6 +179,7 b' class UserModel(BaseModel):'
179 179 'email': user.email,
180 180 'firstname': user.name,
181 181 'lastname': user.lastname,
182 'description': user.description,
182 183 'active': user.active,
183 184 'admin': user.admin,
184 185 'extern_name': user.extern_name,
@@ -225,7 +226,8 b' class UserModel(BaseModel):'
225 226 active=True, admin=False, extern_type=None, extern_name=None,
226 227 cur_user=None, plugin=None, force_password_change=False,
227 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 232 Creates a new instance if not found, or updates current one
231 233
@@ -356,6 +358,7 b' class UserModel(BaseModel):'
356 358 new_user.extern_type = safe_unicode(extern_type)
357 359 new_user.name = firstname
358 360 new_user.lastname = lastname
361 new_user.description = description
359 362
360 363 # set password only if creating an user or password is changed
361 364 if not edit or _password_change(new_user, password):
@@ -167,6 +167,12 b' class UserProfileSchema(colander.Schema)'
167 167 lastname = colander.SchemaNode(
168 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 176 email = colander.SchemaNode(
171 177 colander.String(), widget=deferred_user_email_in_emails_widget,
172 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 186 class AddEmailSchema(colander.Schema):
180 187 current_password = colander.SchemaNode(
181 188 colander.String(),
@@ -68,6 +68,14 b''
68 68 </div>
69 69 <div class="field">
70 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 79 ${_('New Password')}:
72 80 </div>
73 81 <div class="input">
General Comments 0
You need to be logged in to leave comments. Login now