Commit ef95d608 authored by Kevin Deldycke's avatar Kevin Deldycke

Use getattr() to reduce code lenght

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7693 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5549aa10
......@@ -14,7 +14,9 @@
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">bfINCg==</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
......@@ -70,7 +72,7 @@
if brain is not None:\n
o = brain.getObject()\n
url = \'%s/%s\' % (context.REQUEST[\'URL1\'], o.getRelativeUrl())\n
if getattr(context.REQUEST, \'editable_mode\', None):\n
if context.REQUEST.has_key(\'editable_mode\') and context.REQUEST[\'editable_mode\']:\n
url = \'%s/view?editable_mode=%s\' % (url, context.REQUEST[\'editable_mode\'])\n
return url\n
</string> </value>
......@@ -83,7 +85,7 @@ return url\n
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_web/WebSite_getListboxUrl</string> </value>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_web/WebSite_getListboxUrl</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
......@@ -127,7 +129,6 @@ return url\n
<string>o</string>
<string>_getitem_</string>
<string>context</string>
<string>getattr</string>
</tuple>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment