Changeset 8039 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 4 Apr 2012, 11:25:41 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r7819 r8039 163 163 applicant_id = index.Field(attribute='applicant_id') 164 164 reg_number = index.Field(attribute='reg_number') 165 email = index.Field(attribute='email') 165 166 166 167 class ApplicantFactory(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8037 r8039 745 745 form_fields = grok.AutoFields(IApplicantEdit).omit( 746 746 'locked', 'course_admitted', 'student_id', 747 'screening_score', 'reg_number'747 'screening_score', 748 748 ) 749 749 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 750 750 form_fields['phone'].custom_widget = PhoneWidget 751 751 form_fields['applicant_id'].for_display = True 752 form_fields['reg_number'].for_display = True 752 753 grok.template('applicanteditpage') 753 754 manage_applications = False … … 917 918 if applicant.password is not None: 918 919 self.flash(_('Your password has already been set. ' 919 ' You canproceed to the login page.'))920 'Please proceed to the login page.')) 920 921 return 921 922 elif getattr(applicant,'firstname',None) is None: -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8037 r8039 21 21 import shutil 22 22 import tempfile 23 import grok 23 24 from StringIO import StringIO 24 25 from datetime import datetime, date, timedelta 25 26 from mechanize import LinkNotFoundError 27 from zope.event import notify 26 28 from zope.component import createObject, getUtility 27 29 from zope.component.hooks import setSite, clearSite … … 866 868 self.container_path + '/registration_complete?email=xx%40yy.zz') 867 869 return 870 871 def test_change_password_request(self): 872 self.browser.open('http://localhost/app/sendpw') 873 self.browser.getControl(name="form.reg_number").value = '1234' 874 self.browser.getControl(name="form.email").value = 'aa@aa.ng' 875 self.browser.getControl("Get new login credentials").click() 876 self.assertTrue('No record found' in self.browser.contents) 877 self.applicant.email = 'aa@aa.ng' 878 # Update the catalog 879 notify(grok.ObjectModifiedEvent(self.applicant)) 880 self.browser.open('http://localhost/app/sendpw') 881 self.browser.getControl(name="form.reg_number").value = '1234' 882 self.browser.getControl(name="form.email").value = 'aa@aa.ng' 883 self.browser.getControl("Get new login credentials").click() 884 self.assertTrue( 885 'An email with your user name and password has been sent' 886 in self.browser.contents) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/loginpage.pt
r7811 r8039 42 42 <strong><a href ="setpassword"> here</a></strong>. 43 43 </p> 44 <p i18n:translate="login_trouble3"> Or simply forgot your student id or password? Then request a new password45 <strong><a href=" changepw"> here</a></strong>.44 <p i18n:translate="login_trouble3"> Or simply forgot your student id, application id or password? Then request a new password 45 <strong><a href="sendpw"> here</a></strong>. 46 46 </p> 47 47 </form> -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7933 r8039 325 325 326 326 mode = schema.Choice( 327 title = _(u'Import mode'),327 title = _(u'Import Mode'), 328 328 values = ['create', 'update', 'remove'] 329 329 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7997 r8039 1851 1851 """ 1852 1852 grok.context(IUniversity) 1853 grok.name(' changepw')1853 grok.name('sendpw') 1854 1854 grok.require('waeup.Anonymous') 1855 grok.template(' changepw')1856 label = _(' Change mypassword')1855 grok.template('sendpassword') 1856 label = _('Send me a new password') 1857 1857 form_fields = grok.AutoFields(IStudentChangePassword) 1858 1858 … … 1870 1870 # No need to flash something. 1871 1871 return 1872 # Search student 1873 cat = queryUtility(ICatalog, name='students_catalog') 1872 # Search student or applicant 1874 1873 reg_number = data['reg_number'] 1875 1874 email = data['email'] 1875 cat = queryUtility(ICatalog, name='students_catalog') 1876 1876 results = cat.searchResults( 1877 1877 reg_number=(reg_number, reg_number), 1878 1878 email=(email,email)) 1879 1879 if len(results) == 0: 1880 self.flash(_('No student record found.')) 1880 # Try also the applicants_catalog if no student record was found. 1881 cat = queryUtility(ICatalog, name='applicants_catalog') 1882 if cat is None: 1883 self.flash(_('Application package not installed.')) 1884 return 1885 results = cat.searchResults( 1886 reg_number=(reg_number, reg_number), 1887 email=(email,email)) 1888 if len(results) == 0: 1889 self.flash(_('No record found.')) 1881 1890 return 1882 1891 student = list(results)[0] -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/sendpassword.pt
r8025 r8039 17 17 </table> 18 18 19 <p i18n:translate="email_address_problem"> 20 Enter the email address stored on Kofa. 21 You can't change your email address here. 22 If you've forgotten your email address or the email 23 address stored in Kofa is wrong or no longer valid, 24 use the enquiries form to request a change 25 of address. 26 </p> 27 <br /> 19 28 <div tal:condition="view/availableActions"> 20 29 <input tal:repeat="action view/actions" -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r7997 r8039 1643 1643 1644 1644 def test_change_password_request(self): 1645 self.browser.open('http://localhost/app/ changepw')1645 self.browser.open('http://localhost/app/sendpw') 1646 1646 self.browser.getControl(name="form.reg_number").value = '123' 1647 1647 self.browser.getControl(name="form.email").value = 'aa@aa.ng'
Note: See TracChangeset for help on using the changeset viewer.