Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py	(revision 15930)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py	(revision 15932)
@@ -156,4 +156,5 @@
         and copy applicant data.
         """
+        site = grok.getSite()
         # Is applicant in the correct state?
         if self.state != 'admitted':
@@ -164,7 +165,11 @@
             student.reg_number = self.reg_number
         except RegNumNotInSource:
+            # Reset _curr_stud_id 
+            site['students']._curr_stud_id -= 1
             return False, _('Registration Number exists.')
         # Has the course_admitted field been properly filled?
         if self.course_admitted is None:
+            # Reset _curr_stud_id
+            site['students']._curr_stud_id -= 1
             return False, _('No course admitted provided.')
         # Set student attributes
@@ -173,6 +178,8 @@
                 setattr(student, item[1], getattr(self, item[0], None))
         except RequiredMissing, err:
+            site['students']._curr_stud_id -= 1
             return False, 'RequiredMissing: %s' % err
         except:
+            site['students']._curr_stud_id -= 1
             return False, 'Unknown Error'
         # Prove if the certificate still exists
@@ -180,4 +187,6 @@
             StudentStudyCourse().certificate = self.course_admitted
         except ConstraintNotSatisfied, err:
+            # Reset _curr_stud_id
+            site['students']._curr_stud_id -= 1
             return False, 'ConstraintNotSatisfied: %s' % self.course_admitted.code
         # Finally prove if an application slip can be created
@@ -186,13 +195,16 @@
                 view=view)
         except IOError:
+            site['students']._curr_stud_id -= 1
             return False, _('IOError: Application Slip could not be created.')
         except LayoutError, err:
+            site['students']._curr_stud_id -= 1
             return False, _('Reportlab LayoutError: %s' % err)
         except AttributeError, err:
+            site['students']._curr_stud_id -= 1
             return False, _('Reportlab AttributeError: ${a}', mapping = {'a':err})
         except:
+            site['students']._curr_stud_id -= 1
             return False, _('Unknown Reportlab error')
         # Add student
-        site = grok.getSite()
         site['students'].addStudent(student)
         # Save student_id
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 15930)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 15932)
@@ -700,5 +700,5 @@
     """Create all student objects from applicant data
     in the root container or in a specific applicants container only.
-    Only PortalManagers can do this.
+    Only PortalManagers or StudentCreators can do this.
     """
     #grok.context(IApplicantsContainer)
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 15930)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 15932)
@@ -63,4 +63,5 @@
         fd = storage.getFile(file_id)
         file_len_orig = len(fd.read())
+        self.assertEqual(self.app['students']._curr_stud_id, 1000000)
         # Let's try to create the student
         (success, msg) = self.applicant.createStudent()
@@ -68,4 +69,6 @@
         IWorkflowState(self.applicant).setState('admitted')
         (success, msg) = self.applicant.createStudent()
+        # Current student_id has not changed.
+        self.assertEqual(self.app['students']._curr_stud_id, 1000000)
         self.assertTrue(msg == 'No course admitted provided.')
         self.browser.open(self.manage_path)
@@ -77,4 +80,6 @@
         self.assertFalse(success)
         self.assertTrue('ConstraintNotSatisfied: CERT1' in msg)
+        # Current student_id has not changed.
+        self.assertEqual(self.app['students']._curr_stud_id, 1000000)
         # Ok, lets add the certificate and try again
         self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
@@ -85,4 +90,6 @@
         (success, msg) = self.applicant.createStudent()
         self.assertTrue('created' in msg)
+        # Current student_id has not changed.
+        self.assertEqual(self.app['students']._curr_stud_id, 1000001)
         # The applicant is locked
         self.assertTrue(self.applicant.locked)
@@ -116,5 +123,4 @@
         self.assertTrue(len(pdf) > 0)
         self.assertEqual(pdf[:8], '%PDF-1.4')
-        # Copy te file to samples_dir
         path = os.path.join(samples_dir(), 'application_slip.pdf')
         open(path, 'wb').write(pdf)
