Flash messages to notices plus translatable
This commit is contained in:
parent
19ea538097
commit
5b7a9c0855
|
@ -231,10 +231,10 @@ class ViewController(BaseController):
|
||||||
abort(401,self.not_auth_message)
|
abort(401,self.not_auth_message)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if 'Can not create jobs on inactive sources' in str(e):
|
if 'Can not create jobs on inactive sources' in str(e):
|
||||||
h.flash_error('Cannot create new harvest jobs on inactive sources. '
|
h.flash_notice(_('Cannot create new harvest jobs on inactive sources. '
|
||||||
+ 'Please first change the status to \'active\'')
|
+ 'Please first change the status to \'active\''))
|
||||||
elif 'There already is an unrun job for this source' in str(e):
|
elif 'There already is an unrun job for this source' in str(e):
|
||||||
h.flash_error('A harvest job has already been scheduled for this source')
|
h.flash_notice(_('A harvest job has already been scheduled for this source'))
|
||||||
else:
|
else:
|
||||||
msg = 'An error occurred: [%s]' % str(e)
|
msg = 'An error occurred: [%s]' % str(e)
|
||||||
h.flash_error(msg)
|
h.flash_error(msg)
|
||||||
|
|
Loading…
Reference in New Issue