Changeset 17808


Ignore:
Timestamp:
4 Jun 2024, 07:39:13 (7 months ago)
Author:
Henrik Bettermann
Message:

Fix Webservice and test.

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

Legend:

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

    r17787 r17808  
    11631163              'lastname': 'Tester',
    11641164              'matric_number': '234',
    1165               'depcode': 'dep1'}])
     1165              'depcode': 'dep1',
     1166              'sex': 'm'}])
    11661167        REQUEST_XML = """\
    11671168<?xml version="1.0"?>
     
    12051206</member>
    12061207<member>
     1208<name>sex</name>
     1209<value><string>m</string></value>
     1210</member>
     1211<member>
    12071212<name>matric_number</name>
    12081213<value><string>234</string></value>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py

    r17805 r17808  
    543543        """
    544544        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
     545        if current_session:
     546            try:
     547                current_session = int(current_session)
     548            except (TypeError, ValueError):
     549                hitlist.append(dict(error="Wrong parameters"))
     550                return hitlist
     551        if current_level:
     552            try:
     553                current_level = int(current_level)
     554            except (TypeError, ValueError):
     555                hitlist.append(dict(error="Wrong parameters"))
     556                return hitlist
    551557        cat = queryUtility(ICatalog, name='students_catalog')
    552558        results = cat.searchResults(
Note: See TracChangeset for help on using the changeset viewer.