changeset 185:a8d5ba6729f3

bug in delete entries fixes
author dwinter
date Fri, 14 Jun 2013 15:04:35 +0200
parents 2802941bbe2d
children 3ea224968f95
files MPIWGRoot.py MPIWGStaff.py
diffstat 2 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGRoot.py	Thu Jun 13 18:28:58 2013 +0200
+++ b/MPIWGRoot.py	Fri Jun 14 15:04:35 2013 +0200
@@ -517,19 +517,19 @@
         splitted = ident.split(":")
         if len(splitted)!=2:
             logging.debug("getBookLinkFromID: %s not a valid book id, should be MPIWG-Book:XXXX"%ident)
-            return
+            return ""
         
         books = getattr(self,'books',None)
         if books is None:
             logging.debug("getBookLinkFromID: cannot find books page folder")
-            return
+            return ""
         
         
         bookobj = getattr(books,splitted[1],None)
         
         if bookobj is None:
             logging.debug("getBookLinkFromID: %s not a valid book id"%ident)
-            return
+            return ""
         
     
         return "books/"+splitted[1]
--- a/MPIWGStaff.py	Thu Jun 13 18:28:58 2013 +0200
+++ b/MPIWGStaff.py	Fri Jun 14 15:04:35 2013 +0200
@@ -682,15 +682,24 @@
 
             
 
-    
+    security.declareProtected('View management screens','deleteField') 
    
     def deleteField(self,REQUEST):
         """delete entry"""
         
+        CHANGEABLE=['talks','taching','pubmanbiblio']
+        
+        
         
         table = REQUEST.form.get('table',None);
         oid = REQUEST.form.get('oid',None);
         
+        
+        if not table in CHANGEABLE:
+            return
+        if oid is None:
+            oid = REQUEST.form.get('key',None);
+        
         if table is None or oid is None:
             return
         
@@ -754,7 +763,8 @@
         pt=PageTemplateFile('zpt/staff/pubman/show_publications.zpt', globals()).__of__(self)
         return pt(member=self.content)
 
-        
+      
+    security.declareProtected('View management screens','addPublicationsFromPubman')   
     def addPublicationsFromPubman(self,REQUEST):
         """addPublications from pubman"""