changeset 187:71c2d76f09b5

fix editProfile.
author casties
date Fri, 14 Jun 2013 15:49:53 +0200
parents 3ea224968f95
children 16d55695f1c8
files MPIWGStaff.py zpt/staff/edit_profile.zpt
diffstat 2 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGStaff.py	Fri Jun 14 15:29:57 2013 +0200
+++ b/MPIWGStaff.py	Fri Jun 14 15:49:53 2013 +0200
@@ -445,11 +445,9 @@
         if kupu:
             start = kupu.find("<body>")
             end = kupu.find("</body>")
-         
-            newcontent = kupu[start + 6:end]
-            query = "UPDATE personal_www SET profile=%s WHERE key='%s'"       
-            self.executeZSQL(query % (self.ZSQLQuote(newcontent), self.content.key))
-            logging.error("PROFILE:" + query % (self.ZSQLQuote(newcontent), self.content.key))
+            newcontent = kupu[start+6:end]
+            query = "UPDATE personal_www SET profile=%s WHERE key=%s"       
+            self.executeZSQL(query, [newcontent, self.content.key])
         
         if preview: 
             pass
--- a/zpt/staff/edit_profile.zpt	Fri Jun 14 15:29:57 2013 +0200
+++ b/zpt/staff/edit_profile.zpt	Fri Jun 14 15:49:53 2013 +0200
@@ -5,12 +5,8 @@
 <metal:x metal:fill-slot="javascript" tal:define="global onload string:kupu = startKupu();">
   <metal:macros xmlns:metal="http://xml.zope.org/namespaces/metal" use-macro="here/kupuEditor/kupumacros/macros/head">
     <metal:macros fill-slot="bootstrap-editor">
-      <script type="text/javascript" src="/kupuEditor/kupuinit_form.js">
-							
-						</script>
-      <script type="text/javascript" src="/kupuEditor/kupustart_form.js">
-							
-						</script>
+      <script type="text/javascript" src="/kupuEditor/kupuinit_form.js"></script>
+      <script type="text/javascript" src="/kupuEditor/kupustart_form.js"></script>
     </metal:macros>
   </metal:macros>
 </metal:x>
@@ -20,7 +16,7 @@
   <tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
     <form tal:attributes="action string:$root/editProfile" method="post">
       <input type="hidden" name="key" tal:attributes="value here/content/key"/>
-      <tal:x tal:condition="python:(here.content.profile is None) | (here.content.profile=='')">
+      <tal:x tal:condition="not:here/content/profile">
           <p>You haven't edited your profile yet, this entry is generated automatically from you old CV entry, your current work
             entry, and research interests entry from you old profile!</p>
       </tal:x>
@@ -28,7 +24,7 @@
       <div>
         <span class="kupu-tb-buttongroup">
           <button type="button" id="kupu-preview-button" title="preview: alt-p" accesskey="p">Preview</button>
-        </span> 
+        </span>
         <span class="kupu-tb-buttongroup">
           <button type="button" id="kupu-save-button" title="save: alt-s" accesskey="s">Publish</button>
         </span>
@@ -54,7 +50,7 @@
         
         <metal:macros fill-slot="editorframe">
           <iframe class="kupu-editor-iframe" id="kupu-editor" frameborder="0" scrolling="auto" src="fulldoc"
-              tal:attributes="src python:here.REQUEST['URL1']+'/'+here.getStaffURL()+'/getProfile?time='+here.REQUEST.get('time','0')">
+              tal:attributes="src python:root+'/getProfile?time='+here.REQUEST.get('time','0')">
           </iframe>
         </metal:macros>