[Mpuls-commits] r787 - in wasko/branches/2.0: . waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jan 20 15:26:57 CET 2010


Author: bh
Date: 2010-01-20 15:26:56 +0100 (Wed, 20 Jan 2010)
New Revision: 787

Modified:
   wasko/branches/2.0/ChangeLog.txt
   wasko/branches/2.0/waskaweb/controllers/waska.py
Log:
Fix application logic:

* waskaweb/controllers/waska.py (get_remindlist): always return
the max save time reminders. For case managers, also return the
case reminders.
(get_case_appointments): do not include the reminders.


Modified: wasko/branches/2.0/ChangeLog.txt
===================================================================
--- wasko/branches/2.0/ChangeLog.txt	2010-01-20 14:13:59 UTC (rev 786)
+++ wasko/branches/2.0/ChangeLog.txt	2010-01-20 14:26:56 UTC (rev 787)
@@ -1,5 +1,14 @@
 2010-01-20  Bernhard Herzog  <bh at intevation.de>
 
+	Fix application logic:
+
+	* waskaweb/controllers/waska.py (get_remindlist): always return
+	the max save time reminders. For case managers, also return the
+	case reminders.
+	(get_case_appointments): do not include the reminders.
+
+2010-01-20  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/controllers/waska.py (WaskaController.start)
 	(get_remindlist, get_newslist, get_case_appointments)
 	(get_global_appointments): Split most of the code of

Modified: wasko/branches/2.0/waskaweb/controllers/waska.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/waska.py	2010-01-20 14:13:59 UTC (rev 786)
+++ wasko/branches/2.0/waskaweb/controllers/waska.py	2010-01-20 14:26:56 UTC (rev 787)
@@ -49,30 +49,21 @@
 log = logging.getLogger(__name__)
 
 def get_remindlist():
-    # FIXME: This function always returns maxsavetimelist even though it
-    # apparently was meant to return a combined list of maxsavetimelist
-    # and caseremindlist for case managers.
-    maxsavetimelist = MaxSaveTimeReminderOverview()
-    caseremindlist = CaseReminderOverview()
+    """Return an AppointmentOverview instance with reminders.
+    The overview always contains the max save time reminders. For case
+    managers it also contains the case reminders.
+    """
+    remindlist = MaxSaveTimeReminderOverview()
     if h.hasRole(['cm_ka']):
-        #caseremindlist.join(maxsavetimelist)
-        caseremindlist.sort()
-        remindlist = caseremindlist
-    else:
-        remindlist = maxsavetimelist
-    remindlist = maxsavetimelist
+        remindlist.join(CaseReminderOverview())
+        remindlist.sort()
     return remindlist
 
 def get_newslist(user):
     return NewsList(user)
 
 def get_case_appointments():
-    caseapp = CaseAppointmentOverview()
-    if h.hasRole(['cm_ka']):
-        caseremindlist = get_remindlist()
-        caseapp.join(caseremindlist)
-        caseapp.sort()
-    return caseapp
+    return CaseAppointmentOverview()
 
 def get_global_appointments():
     return GlobalAppointmentOverview()



More information about the Mpuls-commits mailing list