Changeset 11642 for main/kofacustom.nigeria/trunk/src/kofacustom
- Timestamp:
- 13 May 2014, 21:23:59 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py
r11639 r11642 22 22 from waeup.kofa.browser.layout import UtilityView, KofaPage 23 23 from waeup.kofa.browser.viewlets import ManageActionButton 24 from waeup.kofa.students.interfaces import IStudentsUtils 24 25 from waeup.kofa.students.browser import OnlinePaymentDisplayFormPage as OPDPStudent 25 26 from waeup.kofa.applicants.browser import OnlinePaymentDisplayFormPage as OPDPApplicant … … 116 117 def update(self): 117 118 if self.context.p_state == 'paid': 118 self.flash(_('This ticket has already been paid.'), type=' warning')119 self.flash(_('This ticket has already been paid.'), type='danger') 119 120 return 120 121 applicant = self.context.__parent__ … … 154 155 xml_data = None 155 156 156 def update(self): 157 #if self.context.p_state != 'unpaid': 158 if self.context.p_state == 'paid': 159 self.flash(_("Payment ticket can't be re-send to CollegePAY.")) 160 self.redirect(self.url(self.context, '@@index')) 161 return 162 163 student = self.student = self.context.student 157 def init_update(self): 158 if self.context.p_state == 'paid': 159 return _("Payment ticket can't be re-sent to CollegePAY.") 160 student = self.context.student 164 161 certificate = getattr(student['studycourse'],'certificate',None) 165 162 if certificate is None: 166 self.flash(_("Study course data are incomplete.")) 167 self.redirect(self.url(self.context, '@@index')) 168 return 163 return _("Study course data are incomplete.") 169 164 kofa_utils = getUtility(IKofaUtils) 165 student_utils = getUtility(IStudentsUtils) 166 if student_utils.samePaymentMade(student, self.context.p_category, 167 self.context.p_item, self.context.p_session): 168 return _("This type of payment has already been made.") 170 169 self.amount_auth = 100 * self.context.amount_auth 171 170 xmldict = {} … … 181 180 self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z") 182 181 self.site_redirect_url = self.url(self.context, 'request_webservice') 183 return student, certificate, xmldict 182 self.student = student 183 self.xmldict = xmldict 184 return 185 186 def update(self): 187 error = self.init_update() 188 if error: 189 self.flash(error, type='danger') 190 self.redirect(self.url(self.context, '@@index')) 191 return 184 192 185 193 class InterswitchPageApplicant(KofaPage): … … 201 209 xml_data = None 202 210 203 def update(self):211 def init_update(self): 204 212 if self.context.p_state != 'unpaid': 205 self.flash(_("Payment ticket can't be re-send to CollegePAY.")) 206 self.redirect(self.url(self.context, '@@index')) 207 return 213 return _("Payment ticket can't be re-sent to CollegePAY.") 208 214 if self.context.__parent__.__parent__.expired \ 209 215 and self.context.__parent__.__parent__.strict_deadline: 210 self.flash(_("Payment ticket can't be send to CollegePAY. " 211 "Application period has expired.")) 212 self.redirect(self.url(self.context, '@@index')) 213 return 216 return _("Payment ticket can't be send to CollegePAY. " 217 "Application period has expired.") 214 218 self.applicant = self.context.__parent__ 215 219 self.amount_auth = 100 * self.context.amount_auth … … 220 224 self.site_redirect_url = self.url(self.context, 'request_webservice') 221 225 return 226 227 def update(self): 228 error = self.init_update() 229 if error: 230 self.flash(error, type='danger') 231 self.redirect(self.url(self.context, '@@index')) 232 return
Note: See TracChangeset for help on using the changeset viewer.