Merge pull request #3729 from sundeep-co-in/STAGE

enable django i18n
This commit is contained in:
Matthew Jones
2016-11-04 15:52:33 -04:00
committed by GitHub
35 changed files with 665 additions and 428 deletions

View File

@@ -124,10 +124,10 @@ class ProjectOptions(models.Model):
scm_url = update_scm_url(self.scm_type, scm_url,
check_special_cases=False)
except ValueError as e:
raise ValidationError((e.args or ('Invalid SCM URL.',))[0])
raise ValidationError((e.args or (_('Invalid SCM URL.'),))[0])
scm_url_parts = urlparse.urlsplit(scm_url)
if self.scm_type and not any(scm_url_parts):
raise ValidationError('SCM URL is required.')
raise ValidationError(_('SCM URL is required.'))
return unicode(self.scm_url or '')
def clean_credential(self):
@@ -136,7 +136,7 @@ class ProjectOptions(models.Model):
cred = self.credential
if cred:
if cred.kind != 'scm':
raise ValidationError("Credential kind must be 'scm'.")
raise ValidationError(_("Credential kind must be 'scm'."))
try:
scm_url = update_scm_url(self.scm_type, self.scm_url,
check_special_cases=False)
@@ -151,7 +151,7 @@ class ProjectOptions(models.Model):
update_scm_url(self.scm_type, self.scm_url, scm_username,
scm_password)
except ValueError as e:
raise ValidationError((e.args or ('Invalid credential.',))[0])
raise ValidationError((e.args or (_('Invalid credential.'),))[0])
except ValueError:
pass
return cred