Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 8722)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 8723)
@@ -30,7 +30,8 @@
     StudentBaseEditFormPage, StudentPersonalEditFormPage,
     OnlinePaymentDisplayFormPage, OnlinePaymentAddFormPage,
-    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage)
+    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage,
+    StudentFilesUploadPage, emit_lock_message)
 from waeup.kofa.students.viewlets import (
-    PaymentReceiptActionButton)
+    PaymentReceiptActionButton, StudentPassportActionButton)
 from waeup.aaue.students.interfaces import (
     ICustomStudentBase, ICustomStudent, ICustomStudentPersonal,
@@ -38,4 +39,5 @@
     ICustomStudentOnlinePayment,
     )
+from waeup.kofa.students.workflow import ADMITTED
 from waeup.aaue.interfaces import MessageFactory as _
 
@@ -207,5 +209,31 @@
 #        note = translate(_(
 #            u"""<br /><br /><br />
-#The tranzaction code for eTranzact payments is <strong>${a}</strong>.""",
+#The tranzaction code is <strong>${a}</strong>.""",
 #            mapping = {'a':tcode}))
 #        return note
+
+class StudentPassportActionButton(StudentPassportActionButton):
+
+    @property
+    def target_url(self):
+        slip = getUtility(IExtFileStore).getFileByContext(
+            self.context, 'application_slip')
+        if self.context.state != ADMITTED or slip is not None:
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class CustomStudentFilesUploadPage(StudentFilesUploadPage):
+    """ View to upload passport picture.
+
+    Students are not allowed to change the picture if they
+    passed the regular Kofa application.
+    """
+
+    def update(self):
+        slip = getUtility(IExtFileStore).getFileByContext(
+            self.context, 'application_slip')
+        if self.context.state != ADMITTED or slip is not None:
+            emit_lock_message(self)
+            return
+        super(StudentFilesUploadPage, self).update()
+        return
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 8722)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 8723)
@@ -19,4 +19,5 @@
 import shutil
 import tempfile
+from StringIO import StringIO
 from hurry.workflow.interfaces import IWorkflowState
 from zope.component.hooks import setSite, clearSite
@@ -26,4 +27,6 @@
 from waeup.kofa.students.tests.test_browser import StudentsFullSetup
 from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.interfaces import (
+    IExtFileStore, IFileStoreNameChooser)
 from waeup.kofa.students.batching import StudentProcessor
 from waeup.kofa.students.interfaces import IStudentsUtils
@@ -287,4 +290,18 @@
         self.browser.getControl(name="form.password").value = 'spwd'
         self.browser.getControl("Login").click()
+        # Even in state admitted students can't change the portait if
+        # application slip exists.
+        IWorkflowState(self.student).setState('admitted')
+        self.browser.open(self.student_path)
+        self.assertTrue('Change portrait' in self.browser.contents)
+        file_store = getUtility(IExtFileStore)
+        applicant_slip = 'My application slip'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="application_slip.pdf")
+        file_store.createFile(file_id, StringIO(applicant_slip))
+        self.browser.open(self.student_path)
+        self.assertFalse('Change portrait' in self.browser.contents)
+        self.browser.open(self.student_path + '/change_portrait')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
         # Student can view and edit clearance data
         self.browser.getLink("Clearance Data").click()
