Changeset 708 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
16 Oct 2006, 16:05:00 (18 years ago)
Author:
joachim
Message:

should fix error traceback when accessing pins on server.

Location:
WAeUP_SRP/trunk/skins/waeup_pins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt

    r696 r708  
    3535            <td tal:content="pin/pin" />
    3636            <td>
    37               <a href="" tal:content="pin/student"
     37              <a tal:condition="pin/student_url" href="" tal:content="pin/student"
    3838                 tal:attributes="href pin/student_url"></a>
     39              <span tal:condition="not: pin/student_url" tal:content="pin/student" />
    3940            </td>
    4041          </tr>
  • WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py

    r696 r708  
    3131    if bd.prefix == "APP":
    3232        jno = item['student']
    33         item['student_url'] = "%s/%s" % (context.portal_url(),
    34                                          context.portal_catalog(SearchableText=jno,
    35                                                                 portal_type='StudentApplication')[0].relative_path
    36                                         )                       
     33        res = context.portal_catalog(SearchableText=jno,portal_type='StudentApplication')
     34        if len(res) == 1:
     35            item['student_url'] = "%s/%s" % (context.portal_url(),res[0].relative_path)
     36        else:
     37            item['student_url'] == None
    3738    else:
    3839        item['student_url'] = '%s/%s' % (students_url,item['student'])
Note: See TracChangeset for help on using the changeset viewer.