Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 11737)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 11738)
@@ -4,4 +4,7 @@
 1.3dev (unreleased)
 ===================
+
+* Use lastname (surname) instead of firstname to verify found application record
+  on ApplicantRegistrationPage.
 
 * Append hash '#' also to datetimes to circumvent unwanted excel automatic.
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 11737)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 11738)
@@ -1105,5 +1105,5 @@
         if self.context.mode == 'update':
             form_fields = grok.AutoFields(IApplicantRegisterUpdate).select(
-                'firstname','reg_number','email')
+                'lastname','reg_number','email')
         else: #if self.context.mode == 'create':
             form_fields = grok.AutoFields(IApplicantEdit).select(
@@ -1149,5 +1149,5 @@
             # Update applicant
             reg_number = data.get('reg_number','')
-            firstname = data.get('firstname','')
+            lastname = data.get('lastname','')
             cat = getUtility(ICatalog, name='applicants_catalog')
             results = list(
@@ -1155,10 +1155,10 @@
             if results:
                 applicant = results[0]
-                if getattr(applicant,'firstname',None) is None:
+                if getattr(applicant,'lastname',None) is None:
                     self.flash(_('An error occurred.'), type='danger')
                     return
-                elif applicant.firstname.lower() != firstname.lower():
+                elif applicant.lastname.lower() != lastname.lower():
                     # Don't tell the truth here. Anonymous must not
-                    # know that a record was found and only the firstname
+                    # know that a record was found and only the lastname
                     # verification failed.
                     self.flash(_('No application record found.'), type='warning')
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 11737)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 11738)
@@ -614,6 +614,11 @@
         )
 
-    firstname = schema.TextLine(
-        title = _(u'First Name'),
+    #firstname = schema.TextLine(
+    #    title = _(u'First Name'),
+    #    required = True,
+    #    )
+
+    lastname = schema.TextLine(
+        title = _(u'Last Name (Surname)'),
         required = True,
         )
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 11737)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 11738)
@@ -1210,5 +1210,5 @@
         self.applicantscontainer.mode = 'update'
         self.browser.open(self.container_path + '/register')
-        self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.lastname").value = 'Better'
         self.browser.getControl(name="form.reg_number").value = 'anynumber'
         self.browser.getControl(name="form.email").value = 'xx@yy.zz'
@@ -1217,8 +1217,8 @@
             in self.browser.contents)
         # Even with the correct reg_number we can't register
-        # because firstname attribute is not set.
+        # because lastname attribute is not set.
         self.applicantscontainer.mode = 'update'
         self.browser.open(self.container_path + '/register')
-        self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.lastname").value = 'Better'
         self.browser.getControl(name="form.reg_number").value = '1234'
         self.browser.getControl(name="form.email").value = 'xx@yy.zz'
@@ -1227,18 +1227,18 @@
         # Let's set this attribute manually
         # and try to register with a wrong name.
-        self.applicant.firstname = u'John'
+        self.applicant.lastname = u'Better'
         self.browser.open(self.container_path + '/register')
-        self.browser.getControl(name="form.firstname").value = 'Johnny'
+        self.browser.getControl(name="form.lastname").value = 'Worse'
         self.browser.getControl(name="form.reg_number").value = '1234'
         self.browser.getControl(name="form.email").value = 'xx@yy.zz'
         self.browser.getControl("Send login credentials").click()
-        # Anonymous is not informed that firstname verification failed.
+        # Anonymous is not informed that lastname verification failed.
         # It seems that the record doesn't exist.
         self.assertTrue('No application record found.'
             in self.browser.contents)
-        # Even with the correct firstname we can't register if a
+        # Even with the correct lastname we can't register if a
         # password has been set and used.
         IWorkflowState(self.applicant).setState('started')
-        self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.lastname").value = 'Better'
         self.browser.getControl(name="form.reg_number").value = '1234'
         self.browser.getControl("Send login credentials").click()
@@ -1252,6 +1252,6 @@
         IWorkflowState(self.applicant).setState('initialized')
         self.browser.open(self.container_path + '/register')
-        # The firstname field, used for verification, is not case-sensitive.
-        self.browser.getControl(name="form.firstname").value = 'jOhn'
+        # The lastname field, used for verification, is not case-sensitive.
+        self.browser.getControl(name="form.lastname").value = 'bEtter'
         self.browser.getControl(name="form.reg_number").value = '1234'
         self.browser.getControl(name="form.email").value = 'new@yy.zz'
