Changeset 16550 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 14 Jul 2021, 06:40:53 (3 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/mandates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
r16059 r16550 22 22 import hashlib 23 23 import os 24 from urllib import urlencode 24 25 from datetime import datetime, timedelta 25 26 from grok import index … … 76 77 'Login with your new password.') 77 78 username = IUserAccount(self.params['user']).name 79 password = self.params['password'] 78 80 grok.getSite().logger.info( 79 81 'PasswordMandate used: %s ' % username) 80 redirect_path = '/login' 82 args = {'login':username, 'password':password} 83 redirect_path = '/login?%s' % urlencode(args) 81 84 del self.__parent__[self.mandate_id] 82 85 return msg, redirect_path -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r15609 r16550 131 131 self.assertEqual(msg, 132 132 'Password has been successfully set. Login with your new password.') 133 self.assertEqual(redirect_path, '/login ')133 self.assertEqual(redirect_path, '/login?login=K1000000&password=mypwd1') 134 134 self.assertTrue(IUserAccount(student).checkPassword('mypwd1')) 135 135 # All mandates have been removed. … … 151 151 self.assertEqual(msg, 152 152 'Password has been successfully set. Login with your new password.') 153 self.assertEqual(redirect_path, '/login ')153 self.assertEqual(redirect_path, '/login?login=bob&password=HgtuZZZ8') 154 154 self.assertTrue(IUserAccount(officer).checkPassword(SECRET)) 155 155 logfile = os.path.join( … … 169 169 self.assertEqual(msg, 170 170 'Password has been successfully set. Login with your new password.') 171 self.assertEqual(redirect_path, '/login ')171 self.assertEqual(redirect_path, '/login?login=abc&password=mypwd1') 172 172 self.assertTrue(IUserAccount(applicant).checkPassword('mypwd1')) 173 173 logfile = os.path.join( … … 226 226 self.assertEqual(len(self.app['mandates'].keys()), 0) 227 227 # We redirect to login page not to the frontpage. 228 self.assertEqual(self.browser.url, 'http://localhost/app/login ')228 self.assertEqual(self.browser.url, 'http://localhost/app/login?login=K1000000&password=mypwd1') 229 229 # Mandate has been deleted 230 230 self.browser.open('http://localhost/app/mandate?mandate_id=%s'
Note: See TracChangeset for help on using the changeset viewer.