Index: openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql	26 May 2003 17:42:18 -0000	1.1
+++ openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql	3 Jun 2003 10:45:44 -0000	1.2
@@ -76,9 +76,6 @@
     v_cur RECORD;
     v_return integer := 0; 
 begin
-    delete from acs_permissions
-    where object_id = p_curriculum_id;
-
     for v_cur in select element_id
                  from   cu_elements
                  where  curriculum_id = p_curriculum_id
@@ -87,6 +84,9 @@
         perform cu_element__del(v_cur.element_id);
     end loop;
 
+    delete from acs_permissions
+    where object_id = p_curriculum_id;
+
     raise NOTICE ''Deleting curriculum - %'',p_curriculum_id;
 
     perform acs_object__delete(p_curriculum_id);
