[Mpuls-commits] r3391 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Aug 12 19:59:20 CEST 2010


Author: bh
Date: 2010-08-12 19:59:18 +0200 (Thu, 12 Aug 2010)
New Revision: 3391

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/renderer.py
Log:
* mpulsweb/lib/renderer.py (ViewRenderer.render)
(ViewRenderer._renderAttributes, ViewRenderer._renderRepeatNav)
(RepeatGroupRenderer.render_digest, RepeatGroupRenderer.render)
(ErrorRenderer.render_items): Use url_for in such a way that it
doesn't use routes memory.  Route memory would for instance add
the confirmed flag to the URLs generated which can lead to repeat
group deletion links that bypass the confirmation step because the
confirmed flag is already true.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-08-12 15:40:12 UTC (rev 3390)
+++ base/trunk/ChangeLog	2010-08-12 17:59:18 UTC (rev 3391)
@@ -1,3 +1,14 @@
+2010-08-12  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/lib/renderer.py (ViewRenderer.render)
+	(ViewRenderer._renderAttributes, ViewRenderer._renderRepeatNav)
+	(RepeatGroupRenderer.render_digest, RepeatGroupRenderer.render)
+	(ErrorRenderer.render_items): Use url_for in such a way that it
+	doesn't use routes memory.  Route memory would for instance add
+	the confirmed flag to the URLs generated which can lead to repeat
+	group deletion links that bypass the confirmation step because the
+	confirmed flag is already true.
+
 2010-08-12  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* mpulsweb/lib/config.py: Added new config var "casetype" in phases

Modified: base/trunk/mpulsweb/lib/renderer.py
===================================================================
--- base/trunk/mpulsweb/lib/renderer.py	2010-08-12 15:40:12 UTC (rev 3390)
+++ base/trunk/mpulsweb/lib/renderer.py	2010-08-12 17:59:18 UTC (rev 3391)
@@ -192,7 +192,7 @@
         out = []
         if not self.ro_mode:
             out.append(tag("form", id="formularpage",
-                           action=url_for(controller="formularpage",
+                           action=url_for(controller="/formularpage",
                                           action="save"),
                            accept_charset="UTF-8",
                            method="POST"))
@@ -281,20 +281,20 @@
         out = []
         if meta.hasHelp():
             out.append(tag("a", target="_blank",
-                           href=url_for(controller="annotations",
+                           href=url_for(controller="/annotations",
                                         action="help", id=meta.getName())))
             out.append(tag("img", src=icon("formular/help.png"), alt="help"))
             out.append('</a>')
         if is_required(meta.getFlags()):
             out.append(tag("a", target="_blank",
-                           href=url_for(controller="annotations",
+                           href=url_for(controller="/annotations",
                                         action="required", id=meta.getName())))
             out.append(tag("img", src=icon("formular/required.png"),
                            width="12", height="12", alt="required"))
             out.append('</a>')
         if is_evaluation_relevant(meta.getFlags()):
             out.append(tag("a", target="_blank",
-                           href=url_for(controller="annotations",
+                           href=url_for(controller="/annotations",
                                         action="evaluation",
                                         id=meta.getName())))
             out.append(tag("img", src=icon("formular/evaluation.png"),
@@ -440,25 +440,25 @@
         out.append('<td class="hcontrol">')
 
         out.append(tag("a", name=_('Select first'),
-                       href=url_for(controller="repeatgroup",
+                       href=url_for(controller="/repeatgroup",
                                     action="select_first", id=child_id)))
         out.append(tag("img", src=icon("go_first_16.png")))
         out.append('</a>')
 
         out.append(tag("a", name=_('Select previous'),
-                       href=url_for(controller="repeatgroup",
+                       href=url_for(controller="/repeatgroup",
                                     action="select_prev", id=child_id)))
         out.append(tag("img", src=icon("go_previous_16.png")))
         out.append('</a>')
 
         out.append(tag("a", name=_('Select next'),
-                       href=url_for(controller="repeatgroup",
+                       href=url_for(controller="/repeatgroup",
                                     action="select_next", id=child_id)))
         out.append(tag("img", src=icon("go_next_16.png")))
         out.append('</a>')
 
         out.append(tag("a", name=_('Select last'),
-                       href=url_for(controller="repeatgroup",
+                       href=url_for(controller="/repeatgroup",
                                     action="select_last", id=child_id)))
         out.append(tag("img", src=icon("go_last_16.png")))
         out.append('</a>')
@@ -467,13 +467,13 @@
 
         if not self.ro_mode:
             out.append(tag("a", name=_('Create new'),
-                           href=url_for(controller="repeatgroup", action="new",
+                           href=url_for(controller="/repeatgroup", action="new",
                                         id=child_id)))
             out.append(tag("img", src=icon("formular/rg_new.png")))
             out.append('</a>')
 
             out.append(tag("a", name=_('Delete'),
-                           href=url_for(controller="repeatgroup",
+                           href=url_for(controller="/repeatgroup",
                                         action="delete", id=child_id)))
             out.append(tag("img", src=icon("formular/rg_delete.png")))
             out.append('</a>')
@@ -911,14 +911,14 @@
                                           case_id))
                 out.append('<tr>')
                 out.append('<td class="label">')
-                out.append(tag("a", href=url_for(controller="navigation",
+                out.append(tag("a", href=url_for(controller="/navigation",
                                                  action="select_branch",
                                                  id=child_identifier)))
                 out.append(escape(self._getMeta(item).getDescription()))
                 out.append('</a>')
                 out.append('</td>')
                 out.append('<td>')
-                out.append(tag("a", href=url_for(controller="navigation",
+                out.append(tag("a", href=url_for(controller="/navigation",
                                                  action="select_branch",
                                                  id=child_identifier)))
                 value = item.getValue()
@@ -988,14 +988,14 @@
             out.append('</td>')
             out.append('<td class="actions">')
             out.append(tag("a",
-                           href=url_for(controller="navigation",
+                           href=url_for(controller="/navigation",
                                         action="select_branch",
                                    id=sd.rg.getChildren()[0].getIdentifier())))
             out.append(tag("img", src=icon("open_active_22.png"),
                            border="0", alt=_('view'), title=_('view')))
             out.append("</a>")
             if not self.ro_mode:
-                out.append(tag("a", href=url_for(controller="repeatgroup",
+                out.append(tag("a", href=url_for(controller="/repeatgroup",
                                                  action="delete",
                                                  id=sd.rg.getIdentifier())))
                 out.append(tag("img", src=icon("delete_active_22.png"),
@@ -1014,7 +1014,7 @@
             out.append('<div>')
             out.append('<br>')
             out.append(tag("a", class_="button",
-                           href=url_for(controller="repeatgroup",
+                           href=url_for(controller="/repeatgroup",
                                         action="new",
                                         id=self.page.getIdentifier())))
             out.append(escape(_('Create new item')))
@@ -1061,7 +1061,7 @@
                 values = [values]
             for v in values:
                 out.append('<li>')
-                out.append(tag("a", href=url_for(controller="formularpage",
+                out.append(tag("a", href=url_for(controller="/formularpage",
                                                  action="undo", id=k)))
                 out.append(tag("img", src=icon("formular/undo.png"),
                                border="0", alt="undo",



More information about the Mpuls-commits mailing list