Changeset 7251


Ignore:
Timestamp:
2 Dec 2011, 12:47:35 (13 years ago)
Author:
Henrik Bettermann
Message:

Minor adjustments in students.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7248 r7251  
    114114
    115115class OnlinePaymentBreadcrumb(Breadcrumb):
    116     """A breadcrumb for course lists.
     116    """A breadcrumb for payments.
    117117    """
    118118    grok.context(IStudentOnlinePayment)
     
    987987
    988988    def unremovable(self, ticket):
    989         prm = get_principal_role_manager()
    990         roles = [x[0] for x in prm.getRolesForPrincipal(self.request.principal.id)]
    991         return ('waeup.Student' in roles and ticket.r_code)
     989        usertype = getattr(self.request.principal, 'user_type', None)
     990        if not usertype:
     991            return False
     992        return (self.request.principal.user_type == 'student' and ticket.r_code)
    992993
    993994    def formatDatetime(self,datetimeobj):
     
    10851086               ticket.p_session == p_session:
    10861087                  self.flash(
    1087                       'This type of payment ticket exists and ticket has been paid.')
     1088                      'This type of payment has already been made.')
    10881089                  self.redirect(self.url(self.context))
    10891090                  return
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7248 r7251  
    10151015        self.browser.getControl("Create ticket").click()
    10161016        self.assertMatches(
    1017             '...This type of payment ticket exists and ticket has been paid...',
     1017            '...This type of payment has already been made...',
    10181018            self.browser.contents)
    10191019
Note: See TracChangeset for help on using the changeset viewer.