Changeset 8315 for WAeUP_SRP/trunk


Ignore:
Timestamp:
30 Apr 2012, 12:15:36 (13 years ago)
Author:
Henrik Bettermann
Message:

We imported empty date fields which caused an exception when accessing payment objects.

With his revision we are catching these exceptions.

Uniben only!

Location:
WAeUP_SRP/trunk/skins/waeup_uniben
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py

    r8205 r8315  
    4747#info['entry_mode'] = sbrain.entry_mode
    4848
     49try:
     50    p_date = payment.date.strftime("%d/%m/%y %H:%M:%S")
     51except:
     52    p_date = '(no payment date provided)'
    4953
     54info['p_date'] = p_date
    5055return info
  • WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py

    r8134 r8315  
    101101    row = {}
    102102    row['id'] = payment.key
     103    try:
     104        p_date = payment.date.strftime("%d/%m/%y %H:%M:%S")
     105    except:
     106        p_date = '(no payment date provided)'
    103107    if payment.status == 'invalid':
    104108        row['title'] = "Invalid Payment, Naira %s, %s" % (payment.amount,
    105                                                           payment.date.strftime("%d/%m/%y %H:%M:%S"))
     109                                                          p_date)
    106110    else:
    107111        row['title'] = "%s for Session %s, Naira %s, %s" % (vocabularies.payment_categories.get(payment.category),
    108112                                                            vocabularies.sessions.get(payment.session_id),
    109113                                                            payment.amount,
    110                                                             payment.date.strftime("%d/%m/%y %H:%M:%S"))
     114                                                            p_date)
    111115    oid = payment.order_id
    112116    onr = oid.rfind('-')+1
  • WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt

    r8211 r8315  
    6565        <tr>
    6666          <td width="220px">Transaction Date:</td>
    67           <td><span tal:content='python:pm.date.strftime("%d/%m/%y %H:%M:%S")' /></td>
     67          <td><span tal:content="info/p_date" /></td>
    6868        </tr>
    6969        <tr>
Note: See TracChangeset for help on using the changeset viewer.