[Mpuls-commits] r2315 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 12 16:58:36 CEST 2010


Author: torsten
Date: 2010-04-12 16:58:36 +0200 (Mon, 12 Apr 2010)
New Revision: 2315

Modified:
   wasko/branches/2.0/mpulsweb/controllers/annotations.py
Log:
* mpulsweb/controllers/annotations.py: Return default string if no
helptext can be found.


Modified: wasko/branches/2.0/mpulsweb/controllers/annotations.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/annotations.py	2010-04-12 14:49:50 UTC (rev 2314)
+++ wasko/branches/2.0/mpulsweb/controllers/annotations.py	2010-04-12 14:58:36 UTC (rev 2315)
@@ -10,6 +10,8 @@
 
 log = logging.getLogger(__name__)
 
+DEFAULT_REQUIRED_TEXT = _('This field is a required field, and must be filled out')
+DEFAULT_EVALUATION_TEXT = _('This field is relevant for evaluation purpose')
 
 class AnnotationsController(BaseController):
 
@@ -43,7 +45,7 @@
             abort(404, _('No help available'))
         c.annotation_header = _('Required field')
         c.annotation_title = nc.getDescription()
-        c.annotation_text = nc.getRequired()
+        c.annotation_text = nc.getRequired() or DEFAULT_REQUIRED_TEXT 
         return render('/annotations/annotation.mako')
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
@@ -53,5 +55,6 @@
             abort(404, _('No help available'))
         c.annotation_header = _('Evaluation relevant field')
         c.annotation_title = nc.getDescription()
-        c.annotation_text = nc.getEvaluation()
+        c.annotation_text = nc.getEvaluation() or \
+            DEFAULT_EVALUATION_TEXT
         return render('/annotations/annotation.mako')



More information about the Mpuls-commits mailing list