Changeset 15412 for main


Ignore:
Timestamp:
16 May 2019, 13:59:24 (5 years ago)
Author:
Henrik Bettermann
Message:

Allow score editing only in states courses registered and validated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r15398 r15412  
    2727from zope.interface import implementedBy
    2828from waeup.kofa.utils.helpers import attrs_to_fields
    29 from waeup.kofa.interfaces import RETURNING
     29from waeup.kofa.interfaces import RETURNING, VALIDATED, REGISTERED
    3030from waeup.kofa.students.browser import TicketError
    3131from waeup.kofa.students.studylevel import (
     
    424424        """True if lecturer is allowed to edit the ticket.
    425425        """
    426         return True
     426        try:
     427            cas = grok.getSite()[
     428                'configuration'].current_academic_session
     429            if self.student.state in (VALIDATED, REGISTERED) and \
     430                self.student.current_session == cas:
     431                return True
     432        except (AttributeError, TypeError): # in unit tests
     433            pass
     434        return False
    427435
    428436CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
Note: See TracChangeset for help on using the changeset viewer.