Changeset 17794 for main/waeup.kofa


Ignore:
Timestamp:
17 May 2024, 07:07:50 (6 months ago)
Author:
Henrik Bettermann
Message:

Fix webservice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py

    r17793 r17794  
    540540            current_session=None, current_level=None, certcode=None,
    541541            current_mode=None, faccode=None, depcode=None, p_session=None):
    542         """Returns bursary data of a subset of students.
    543         """
    544         if not current_session:
    545             current_session = None
    546         if not current_level:
    547             current_level = None
    548         if not depcode:
    549             depcode = None
    550         if not certcode:
    551             certcode = None
    552         if not current_mode:
    553             current_mode = None
     542        """Returns base data of a subset of students.
     543        """
    554544        hitlist = []
     545        try:
     546            current_session = int(current_session)
     547            current_level = int(current_level)
     548        except (TypeError, ValueError):
     549            hitlist.append(dict(error="Wrong parameters"))
     550            return hitlist
    555551        cat = queryUtility(ICatalog, name='students_catalog')
    556552        results = cat.searchResults(
     
    562558                depcode=(depcode, depcode),
    563559                )
     560        if len(results) > 500:
     561            hitlist.append(dict(error="Too many objects (500 max)"))
     562            return hitlist
    564563        for student in results:
    565564            hitlist.append(dict(
Note: See TracChangeset for help on using the changeset viewer.