Changeset 10146 for main/waeup.futminna
- Timestamp:
- 2 May 2013, 20:01:17 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/applicants/applicant.py
r9065 r10146 19 19 import grok 20 20 from zope.interface import implementedBy 21 from zope.component import getUtility 22 from waeup.kofa.interfaces import IExtFileStore 21 23 from waeup.kofa.applicants.applicant import ApplicantFactory 22 24 from waeup.kofa.utils.helpers import attrs_to_fields … … 24 26 from waeup.futminna.applicants.interfaces import( 25 27 ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit) 28 29 @grok.subscribe(ICustomApplicant, grok.IObjectRemovedEvent) 30 def custom_handle_applicant_removed(applicant, event): 31 """If an applicant is removed also pdf files of this applicant are removed. 32 """ 33 file_store = getUtility(IExtFileStore) 34 file_store.deleteFileByContext(applicant, attr='extraform.pdf') 35 file_store.deleteFileByContext(applicant, attr='refereeform.pdf') 36 return 26 37 27 38 class CustomApplicant(NigeriaApplicant): -
main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests/test_browser.py
r10105 r10146 151 151 % (self.applicant.applicant_id) 152 152 in logcontent) 153 # When an applicant is removed, also the pdf files are gone. 154 del self.app['applicants']['app2011'][self.applicant.application_number] 155 fd = storage.getFile(file_id) 156 self.assertTrue(fd is None) 153 157 154 158 def test_upload_refereeform_by_student(self): … … 238 242 % (self.applicant.applicant_id) 239 243 in logcontent) 244 # When an applicant is removed, also the pdf files are gone. 245 del self.app['applicants']['app2011'][self.applicant.application_number] 246 fd = storage.getFile(file_id) 247 self.assertTrue(fd is None)
Note: See TracChangeset for help on using the changeset viewer.