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.3 -r1.4
--- openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql	3 Jun 2003 18:51:49 -0000	1.3
+++ openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql	10 Jun 2003 09:29:19 -0000	1.4
@@ -76,6 +76,9 @@
     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
@@ -84,9 +87,6 @@
         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);
