Link to enrollment form in proposal submission's error message.

Added hyperlink to enrollment form in error message of
proposal submission page.

Change-Id: I43b337eb69cbb3e8cd44b3dcd1c43bfb1a787b30
diff --git a/app/summerofcode/views/proposal.py b/app/summerofcode/views/proposal.py
index 9b825cf..a1708f8 100644
--- a/app/summerofcode/views/proposal.py
+++ b/app/summerofcode/views/proposal.py
@@ -119,8 +119,8 @@
     (_VISIBILITY_PUBLIC_ID, translation.ugettext('Public')))
 
 _MESSAGE_ENROLLMENT_FORM_REQUIRED = translation.ugettext(
-    'Having submitted a proof of enrollment is required, before you can '
-    'submit a new proposal.')
+    'You must provide <a href="%s">proof of enrollment</a> before '
+    'you can submit a proposal.')
 
 _MESSAGE_PROPOSAL_LIMIT_REACHED = translation.ugettext(
     'You have reached the maximum number of proposals (%d) allowed '
@@ -378,7 +378,10 @@
   def checkAccess(self, data, check):
     """See AccessChecker.checkAccess for specification."""
     if not profile_logic.enrollmentFormSubmitted(data.ndb_profile):
-      raise exception.Forbidden(message=_MESSAGE_ENROLLMENT_FORM_REQUIRED)
+      raise exception.Forbidden(
+          message=html.mark_safe(_MESSAGE_ENROLLMENT_FORM_REQUIRED % (
+              links.ABSOLUTE_LINKER.program(
+                  data.program, 'gsoc_enrollment_form', secure=True))))
 
 
 PROPOSAL_SUBMIT_ACCESS_CHECKER = access.ConjuctionAccessChecker([
diff --git a/tests/app/summerofcode/views/test_proposal.py b/tests/app/summerofcode/views/test_proposal.py
index 444f1e7..8981ee8 100644
--- a/tests/app/summerofcode/views/test_proposal.py
+++ b/tests/app/summerofcode/views/test_proposal.py
@@ -23,6 +23,7 @@
 
 from melange.models import organization as org_model
 from melange.request import exception
+from melange.request import links
 from melange.utils import rich_bool
 
 from seeder import profile as profile_seeder
@@ -613,6 +614,11 @@
       access_checker.checkAccess(self.data, None)
     self.assertEqual(context.exception.status, httplib.FORBIDDEN)
 
+    # Test enrollment form URL
+    enrollment_url = links.ABSOLUTE_LINKER.program(
+        self.data.program, 'gsoc_enrollment_form', secure=True)
+    self.assertIn(enrollment_url, context.exception.message)
+
 
 _TEST_SCORE_VALUE = 4
 _TEST_UPDATED_SCORE_VALUE = 1