comparison rhodecode/controllers/pullrequests.py @ 4080:b622e6849b67

pull requests: give slightly more useful error messages on failing form validation
author Mads Kiilerich <madski@unity3d.com>
date Wed, 12 Jun 2013 12:23:20 +0200
parents a2218bdbf45d
children ffd45b185016
comparison
equal deleted inserted replaced
4079:7e897077bb40 4080:b622e6849b67
320 if errors.error_dict.get('revisions'): 320 if errors.error_dict.get('revisions'):
321 msg = 'Revisions: %s' % errors.error_dict['revisions'] 321 msg = 'Revisions: %s' % errors.error_dict['revisions']
322 elif errors.error_dict.get('pullrequest_title'): 322 elif errors.error_dict.get('pullrequest_title'):
323 msg = _('Pull request requires a title with min. 3 chars') 323 msg = _('Pull request requires a title with min. 3 chars')
324 else: 324 else:
325 msg = _('Error creating pull request') 325 msg = _('Error creating pull request: %s') % errors.msg
326 326
327 h.flash(msg, 'error') 327 h.flash(msg, 'error')
328 return redirect(url('pullrequest_home', repo_name=repo_name)) 328 return redirect(url('pullrequest_home', repo_name=repo_name)) ## would rather just go back to form ...
329 329
330 org_repo = _form['org_repo'] 330 org_repo = _form['org_repo']
331 org_ref = _form['org_ref'] # will end with merge_rev but have symbolic name 331 org_ref = _form['org_ref'] # will end with merge_rev but have symbolic name
332 other_repo = _form['other_repo'] 332 other_repo = _form['other_repo']
333 other_ref = 'rev:ancestor:%s' % _form['ancestor_rev'] # could be calculated from other_ref ... 333 other_ref = 'rev:ancestor:%s' % _form['ancestor_rev'] # could be calculated from other_ref ...