Ignore:
Timestamp:
29 Jan 2026, 01:54:43 (10 months ago)
Author:
Henrik Bettermann
Message:

Set the minimum credit for spill-over students to 2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/utils.py

    r18215 r18235  
    5656            #    if studylevel.level == 400 and studylevel.total_credits < 29:
    5757            #        return _('Minimum credits not reached.')
    58             if studylevel.level in (300, 400):
     58            # Spillover students must register at least 2 credits
     59            end_level = 999
     60            certificate = getattr(studylevel.__parent__, 'certificate', None)
     61            if certificate is not None:
     62                end_level = int(certificate.end_level)
     63            level,repeat = divmod(studylevel.level, 100)
     64            level = level * 100
     65            repeat = repeat//10
     66            if level > end_level and repeat:
     67                if studylevel.total_credits < 2:
     68                    return _('Minimum credits not reached.')
     69            elif studylevel.level in (300, 400):
    5970                if studylevel.total_credits < 27:
    6071                    return _('Minimum credits not reached.')
Note: See TracChangeset for help on using the changeset viewer.