[Mpuls-commits] r886 - wasko/branches/2.0/waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 26 14:57:35 CET 2010


Author: torsten
Date: 2010-01-26 14:57:35 +0100 (Tue, 26 Jan 2010)
New Revision: 886

Modified:
   wasko/branches/2.0/waskaweb/controllers/case.py
Log:
* waskaweb/controllers/case.py (CaseController.newLogbookEntry): Cleanup
* function. Removed uneeded vars. Added some debugging.


Modified: wasko/branches/2.0/waskaweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/case.py	2010-01-26 13:39:20 UTC (rev 885)
+++ wasko/branches/2.0/waskaweb/controllers/case.py	2010-01-26 13:57:35 UTC (rev 886)
@@ -868,17 +868,20 @@
 
     @checkRole('cm_ka')
     def newLogbookEntry(self, id):
+        id = self._checkInt(id)
+
         entry = LogbookEntry()
         entry.setDate(datetime.now())
         entry.setKind(-1)
+
         form_defaults = {}
+        c.form_errors = {}
+
         form_defaults['date'] = entry.getDate()
         form_defaults['time'] = entry.getTime()
         form_defaults['kind'] = entry.getKindAsInt()
-        id = self._checkInt(id)
-        c.ds_id = id
-        c.entry = entry
-        c.form_errors = {}
+        form_defaults['case_id'] = id
+
         form = render('/logbook/new.mako')
         return formencode.htmlfill.render(unicode(form, 'utf-8'),
                                           defaults=form_defaults,
@@ -936,6 +939,7 @@
         #    c.form_errors     = checker.getErrors()
 
         try:
+            log.debug("New Logbook entry from case %s" % checker.getCaseId())
             logbook = Logbook(checker.getCaseId())
             logbook.addEntry(checker.getLogbookEntry())
             logbook.store(session['USER_AUTHORIZED'].id)



More information about the Mpuls-commits mailing list