[Mpuls-commits] r6015 - in base/trunk/mpulsweb: controllers templates/phase/dialogs

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 3 13:59:35 CEST 2012


Author: ludwig
Date: 2012-08-03 13:59:35 +0200 (Fri, 03 Aug 2012)
New Revision: 6015

Modified:
   base/trunk/mpulsweb/controllers/phase.py
   base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako
Log:
Update of setPhase. If a phase ist set and meta is linked the case is
automaticly uploaded/pushed to the meta server.


Modified: base/trunk/mpulsweb/controllers/phase.py
===================================================================
--- base/trunk/mpulsweb/controllers/phase.py	2012-08-03 11:33:30 UTC (rev 6014)
+++ base/trunk/mpulsweb/controllers/phase.py	2012-08-03 11:59:35 UTC (rev 6015)
@@ -34,6 +34,17 @@
         c.show_meta_case_hint = (g.mpuls_config.is_enabled('case-module',
                                                            'meta-server')
                                  and case.getMeta().is_linked())
+        if g.mpuls_config.is_enabled('case-module', 'meta-server') \
+        and case.getMeta().is_linked():
+            try:
+                case.getMeta().push()
+                c.show_meta_case_upload_hint =_('The data was sucessfully '
+                                                'uploaded to the meta case.')
+            except MetaException, exc:
+                c.show_meta_case_upload_hint = _('Error! Data not uploaded.')
+                self._handle_meta_exception(meta, exc, "push",
+                                               _('Error! Data not uploaded.'))
+
         c.dialog_title = _("Phase changed!")
         c.dialog_text = _("The phase could be changed successfully."
                           " Please follow the shown steps to reach the phase"

Modified: base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako
===================================================================
--- base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako	2012-08-03 11:33:30 UTC (rev 6014)
+++ base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako	2012-08-03 11:59:35 UTC (rev 6015)
@@ -11,9 +11,9 @@
   <p>${c.dialog_text | F.NA}</p>
   <div class="import_box_dialog">
     <ol>
-      % if c.show_meta_case_hint:
+      % if c.show_meta_case_upload_hint:
       <li>
-        ${_('It is strongly recommended to sync the case with its meta-case after changing the phase as this is a significant change in the support of the client. Please open the meta-case to sync the updated case to the meta-server.')}<br>
+        ${c.show_meta_case_upload_hint}<br> 
         <a class="button import" href="${h.url(controller='meta', action='index', id=session.get('case').id)}">${_('Meta case')}</a>
         <br>
         <br>



More information about the Mpuls-commits mailing list