Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 11591)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 11592)
@@ -544,7 +544,9 @@
         if student.certcode is None:
             return _('No certificate assigned.'), None
+        matric_number = self._constructMatricNumber(student, next_integer)
+        if not matric_number:
+            return _('Matriculation number cannot be set.'), None
         try:
-            student.matric_number = self._constructMatricNumber(
-                student, next_integer)
+            student.matric_number = matric_number
         except MatNumNotInSource:
             return _('Matriculation number exists.'), None
