[Mpuls-commits] r2610 - wasko/branches/2.0/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 4 12:15:49 CEST 2010


Author: torsten
Date: 2010-05-04 12:15:49 +0200 (Tue, 04 May 2010)
New Revision: 2610

Modified:
   wasko/branches/2.0/mpulsweb/model/appointment.py
Log:
* mpulsweb/model/appointment.py
	(MaxSaveTimeReminderOverview.__init__): Add default phases on
	casesearch.


Modified: wasko/branches/2.0/mpulsweb/model/appointment.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/appointment.py	2010-05-04 10:14:50 UTC (rev 2609)
+++ wasko/branches/2.0/mpulsweb/model/appointment.py	2010-05-04 10:15:49 UTC (rev 2610)
@@ -36,6 +36,7 @@
 from mpulsweb.lib.db import db
 from mpulsweb.model.case import MpulsCaseOverview
 from mpulsweb.model.agencysettings import Agency
+from mpulsweb.controllers.case_overview import default_phases 
 
 
 GET_GLOBAL_APPOINTMENT_SQL = """\
@@ -466,12 +467,17 @@
         # savetime on them
         default_search_options = ['own:%s' % user.id, 'standin:%s' % user.id,
                                   'state:1', 'state:2', 'state:3']
+        # Get phasepart ids for the selected phasepairs. Only if pairs are
+        # defined.
+        for p in default_phases(): 
+            default_search_options.append('phase:%s' % p)
         cases.search(";".join(default_search_options))
 
         # 2. filter cases which seems to be orphaned and create reminders
         oldAndActiveSet = set(oldAndActive)
         old_cases = [case for case in cases.getDatasets()
                      if case.id in oldAndActiveSet]
+        log.debug('oldcases: %s' % old_cases)
         for case in old_cases:
             info = oldAndActive[case.id]
             last = info['last_date']



More information about the Mpuls-commits mailing list