Changeset 15628
- Timestamp:
- 1 Oct 2019, 08:46:59 (5 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r15610 r15628 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Take `DELETION_MARKER` into consideration when updating passwords. 6 8 7 9 * Implement parents access to student data. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
r14804 r15628 27 27 from zope.catalog.interfaces import ICatalog 28 28 from waeup.kofa.interfaces import ( 29 IBatchProcessor, IObjectConverter, FatalCSVError, IGNORE_MARKER, 29 IBatchProcessor, IObjectConverter, FatalCSVError, 30 IGNORE_MARKER, DELETION_MARKER, 30 31 IObjectHistory, IUserAccount, DuplicationError) 31 32 from waeup.kofa.interfaces import MessageFactory as _ … … 243 244 row.pop('application_number') 244 245 245 # Update password246 # Update 246 247 if 'password' in row: 247 248 passwd = row.get('password', IGNORE_MARKER) … … 250 251 # already encrypted password 251 252 obj.password = passwd 253 elif passwd == DELETION_MARKER: 254 obj.password = None 252 255 else: 253 256 # not yet encrypted password -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r15446 r15628 37 37 from waeup.kofa.interfaces import ( 38 38 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 39 IObjectHistory, VALIDATED, REGISTERED, IGNORE_MARKER )39 IObjectHistory, VALIDATED, REGISTERED, IGNORE_MARKER, DELETION_MARKER) 40 40 from waeup.kofa.interfaces import IKofaUtils, DuplicationError 41 41 from waeup.kofa.interfaces import MessageFactory as _ … … 213 213 214 214 # Update password 215 # XXX: Take DELETION_MARKER into consideration216 215 if 'password' in row: 217 216 passwd = row.get('password', IGNORE_MARKER) … … 220 219 # already encrypted password 221 220 obj.password = passwd 221 elif passwd == DELETION_MARKER: 222 obj.password = None 222 223 else: 223 224 # not yet encrypted password -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv
r13100 r15628 1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,state 2 X666666,Aaren,Pieri,1,1990-01-02,100000,,1234,M,courses validated 3 Y777777,Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,courses validated 4 ,Susann,Berson,3,1990-01-04,100002,aa@aa.ng,1234,F,courses validated 5 ,Else,Mueller,4,1990-01-05,100003,aa@aa.ng,1234,f,school fee paid 6 ,,,,,,,,, 7 ,,,, ,,, ,, 8 ,,,,<IGNORE>,,,<IGNORE>,, 9 X888888,Alfons,Meier,5,1990-01-02,100004,aa@aa.ng,1234,m,courses validated 10 X999999,Herbert,Mueller,6,1990-01-02,100005,aa@aa.ng,1234,m,courses registered 11 X111111,Fabian,Riester,7,1990-01-02,100006,aa@aa.ng,1234,m,courses validated 12 X222222,Thomas,Kinderman,8,1990-01-02,100007,aa@aa.ng,1234,m,courses validated 13 X333333,Paula,Schall,9,1990-01-02,100008,aa@aa.ng,1234,m,courses registered 1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,state,password 2 X666666,Aaren,Pieri,1,1990-01-02,100000,,1234,M,courses validated,test1234 3 Y777777,Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,courses validated, 4 ,Susann,Berson,3,1990-01-04,100002,aa@aa.ng,1234,F,courses validated, 5 ,Else,Mueller,4,1990-01-05,100003,aa@aa.ng,1234,f,school fee paid, 6 ,,,,,,,,,, 7 ,,,, ,,, ,,, 8 ,,,,<IGNORE>,,,<IGNORE>,,, 9 X888888,Alfons,Meier,5,1990-01-02,100004,aa@aa.ng,1234,m,courses validated, 10 X999999,Herbert,Mueller,6,1990-01-02,100005,aa@aa.ng,1234,m,courses registered, 11 X111111,Fabian,Riester,7,1990-01-02,100006,aa@aa.ng,1234,m,courses validated, 12 X222222,Thomas,Kinderman,8,1990-01-02,100007,aa@aa.ng,1234,m,courses validated, 13 X333333,Paula,Schall,9,1990-01-02,100008,aa@aa.ng,1234,m,courses registered, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data_update2.csv
r8229 r15628 1 date_of_birth,matric_number,phone 2 1970-01-02,100000, 3 1970-01-03,100001,XXX 4 1970-01-04,100002,<IGNORE> 1 date_of_birth,matric_number,phone,password 2 1970-01-02,100000,,XXX 3 1970-01-03,100001,XXX, 4 1970-01-04,100002,<IGNORE>, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r15421 r15628 451 451 self.csv_file, STUDENT_HEADER_FIELDS) 452 452 shutil.rmtree(os.path.dirname(fin_file)) 453 container = self.app['students'] 454 self.assertEqual( 455 IUserAccount(container['X666666']).checkPassword('test1234'), True) 453 456 num, num_warns, fin_file, fail_file = self.processor.doImport( 454 457 self.csv_file_update2, STUDENT_HEADER_FIELDS_UPDATE2, 'update') … … 456 459 # The phone import value of Pieri was None. 457 460 # Confirm that phone has not been cleared. 458 container = self.app['students']459 461 for key in container.keys(): 460 462 if container[key].firstname == 'Aaren': … … 469 471 break 470 472 assert claus.phone is None 473 # The password of X666666 has been removed 474 self.assertEqual( 475 IUserAccount(container['X666666']).password, None) 471 476 shutil.rmtree(os.path.dirname(fin_file)) 472 477
Note: See TracChangeset for help on using the changeset viewer.