##// END OF EJS Templates
fixed bug when new repo had no last commiter,...
marcink -
r489:460ad816 celery
parent child Browse files
Show More
@@ -260,7 +260,8 class SettingsController(BaseController)
260 # url('admin_settings_my_account_update', id=ID)
260 # url('admin_settings_my_account_update', id=ID)
261 user_model = UserModel()
261 user_model = UserModel()
262 uid = c.hg_app_user.user_id
262 uid = c.hg_app_user.user_id
263 _form = UserForm(edit=True, old_data={'user_id':uid})()
263 _form = UserForm(edit=True, old_data={'user_id':uid,
264 'email':c.hg_app_user.email})()
264 form_result = {}
265 form_result = {}
265 try:
266 try:
266 form_result = _form.to_python(dict(request.POST))
267 form_result = _form.to_python(dict(request.POST))
@@ -269,7 +270,11 class SettingsController(BaseController)
269 category='success')
270 category='success')
270
271
271 except formencode.Invalid as errors:
272 except formencode.Invalid as errors:
272 #c.user = self.sa.query(User).get(c.hg_app_user.user_id)
273 c.user = self.sa.query(User).get(c.hg_app_user.user_id)
274 c.user_repos = []
275 for repo in c.cached_repo_list.values():
276 if repo.dbrepo.user.username == c.user.username:
277 c.user_repos.append(repo)
273 return htmlfill.render(
278 return htmlfill.render(
274 render('admin/users/user_edit_my_account.html'),
279 render('admin/users/user_edit_my_account.html'),
275 defaults=errors.value,
280 defaults=errors.value,
@@ -221,6 +221,7 class EmptyChangeset(BaseChangeset):
221
221
222 revision = -1
222 revision = -1
223 message = ''
223 message = ''
224 author = ''
224
225
225 @LazyProperty
226 @LazyProperty
226 def raw_id(self):
227 def raw_id(self):
@@ -429,4 +430,5 OXDGKEud/R8efZUt\n
429 tar.close()
430 tar.close()
430
431
431
432
433
432 No newline at end of file
434
@@ -209,8 +209,10 class ValidPath(formencode.validators.Fa
209 raise formencode.Invalid(msg, value, state,
209 raise formencode.Invalid(msg, value, state,
210 error_dict={'paths_root_path':msg})
210 error_dict={'paths_root_path':msg})
211
211
212 class UniqSystemEmail(formencode.validators.FancyValidator):
212 def UniqSystemEmail(old_data):
213 class _UniqSystemEmail(formencode.validators.FancyValidator):
213 def to_python(self, value, state):
214 def to_python(self, value, state):
215 if old_data['email'] != value:
214 sa = meta.Session
216 sa = meta.Session
215 try:
217 try:
216 user = sa.query(User).filter(User.email == value).scalar()
218 user = sa.query(User).filter(User.email == value).scalar()
@@ -222,6 +224,8 class UniqSystemEmail(formencode.validat
222
224
223 return value
225 return value
224
226
227 return _UniqSystemEmail
228
225 class ValidSystemEmail(formencode.validators.FancyValidator):
229 class ValidSystemEmail(formencode.validators.FancyValidator):
226 def to_python(self, value, state):
230 def to_python(self, value, state):
227 sa = meta.Session
231 sa = meta.Session
@@ -276,7 +280,7 def UserForm(edit=False, old_data={}):
276 active = StringBoolean(if_missing=False)
280 active = StringBoolean(if_missing=False)
277 name = UnicodeString(strip=True, min=3, not_empty=True)
281 name = UnicodeString(strip=True, min=3, not_empty=True)
278 lastname = UnicodeString(strip=True, min=3, not_empty=True)
282 lastname = UnicodeString(strip=True, min=3, not_empty=True)
279 email = All(Email(not_empty=True), UniqSystemEmail())
283 email = All(Email(not_empty=True), UniqSystemEmail(old_data))
280
284
281 return _UserForm
285 return _UserForm
282
286
@@ -77,7 +77,7 E.onDOMReady(function(e){
77 </div>
77 </div>
78 <div class="input-short">
78 <div class="input-short">
79 ${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}
79 ${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}
80 ${_('by')} ${c.repo_info.get_changeset('tip').author}
80 ${_('by')} ${h.get_changeset_safe(c.repo_info,'tip').author}
81
81
82 </div>
82 </div>
83 </div>
83 </div>
General Comments 0
You need to be logged in to leave comments. Login now