Ignore:
Timestamp:
5 Jul 2024, 21:10:23 (6 months ago)
Author:
Henrik Bettermann
Message:

Fix webservices.

File:
1 edited

Legend:

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

    r17808 r17833  
    410410        """Returns bursary data of a subset of students.
    411411        """
     412        hitlist = []
    412413        if not current_session:
    413414            current_session = None
     415        else:
     416            try:
     417                current_session = int(current_session)
     418            except (TypeError, ValueError):
     419                hitlist.append(dict(error="Wrong parameters"))
     420                return hitlist
    414421        if not current_level:
    415422            current_level = None
     423        else:
     424            try:
     425                current_level = int(current_level)
     426            except (TypeError, ValueError):
     427                hitlist.append(dict(error="Wrong parameters"))
     428                return hitlist
    416429        if not depcode:
    417430            depcode = None
     
    420433        if not current_mode:
    421434            current_mode = None
    422         hitlist = []
    423435        cat = queryUtility(ICatalog, name='students_catalog')
    424436        results = list(
     
    543555        """
    544556        hitlist = []
    545         if current_session:
     557        if not current_session:
     558            current_session = None
     559        else:
    546560            try:
    547561                current_session = int(current_session)
     
    549563                hitlist.append(dict(error="Wrong parameters"))
    550564                return hitlist
    551         if current_level:
     565        if not current_level:
     566            current_level = None
     567        else:
    552568            try:
    553569                current_level = int(current_level)
     
    555571                hitlist.append(dict(error="Wrong parameters"))
    556572                return hitlist
     573        if not depcode:
     574            depcode = None
     575        if not certcode:
     576            certcode = None
     577        if not current_mode:
     578            current_mode = None
    557579        cat = queryUtility(ICatalog, name='students_catalog')
    558580        results = cat.searchResults(
Note: See TracChangeset for help on using the changeset viewer.