[Greater-commits] r3756 - branches/3.0.0-usf/GREAT-ERModel/GreaterModel/Worker

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 29 19:48:38 CEST 2011


Author: aheinecke
Date: 2011-07-29 19:48:37 +0200 (Fri, 29 Jul 2011)
New Revision: 3756

Modified:
   branches/3.0.0-usf/GREAT-ERModel/GreaterModel/Worker/dischargemodels.py
Log:
Check for R_wwtp before accessing it


Modified: branches/3.0.0-usf/GREAT-ERModel/GreaterModel/Worker/dischargemodels.py
===================================================================
--- branches/3.0.0-usf/GREAT-ERModel/GreaterModel/Worker/dischargemodels.py	2011-07-29 15:20:28 UTC (rev 3755)
+++ branches/3.0.0-usf/GREAT-ERModel/GreaterModel/Worker/dischargemodels.py	2011-07-29 17:48:37 UTC (rev 3756)
@@ -84,7 +84,7 @@
                           2:'R_ACTIVATED_SLUDGE',
                           3:'R_TRICKLING_FILTER'}
 
-        if self.type is not None:
+        if self.type is not None and self.type in R_type_mapping:
             R_key = R_type_mapping[self.type]
             R_wwtp, status = eval_local_setting( data, 
                             ('EMISSION', ID, 'wwtp_removal'),
@@ -132,7 +132,7 @@
             Overflow_perc = 100
 
         # determine elimination of substance from treated wastewater
-        if self.R_wwtp is not None and self.Pop > 0:
+        if hasattr(self, "R_wwtp") and self.R_wwtp is not None and self.Pop > 0:
             if shot_num > 0 and self.R_wwtp.distribution > 0 and \
                     (eval_parameter(self.session.data, \
                     ('EMISSION', self.ID, 'wwtp_removal')) is None):



More information about the Greater-commits mailing list