Ignore:
Timestamp:
4 Feb 2021, 09:14:47 (4 years ago)
Author:
Henrik Bettermann
Message:

Improve wevservice.

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

    r16392 r16393  
    241241        result = server.get_students_by_department('fac1','dep1', '2012', '100')
    242242        self.assertEqual(
    243             result, {'K1000000': ['234', 'Anna Tester', ['COURSE1', 'COURSE2']]})
     243            result, {'K1000000': [
     244            '234', 'Anna Tester', 2004, 100, ['COURSE1', 'COURSE2']]})
     245        result = server.get_students_by_department('fac1','dep1', '0', '100')
     246        self.assertEqual(
     247            result, {'K1000000': [
     248            '234', 'Anna Tester', 2004, 100, ['COURSE1', 'COURSE2']]})
    244249        result = server.get_students_by_department('fac1','dep1')
    245250        self.assertEqual(
    246             result, {'K1000000': ['234', 'Anna Tester', ['COURSE1', 'COURSE2']]})
     251            result, {'K1000000': [
     252            '234', 'Anna Tester', 2004, 100, ['COURSE1', 'COURSE2']]})
    247253        result = server.get_students_by_department('fac1','dep2')
    248254        self.assertEqual(result, None)
     
    255261<value><string>fac1</string></value>
    256262<value><string>dep1</string></value>
     263<value><int>0</int></value>
     264<value><int>100</int></value>
    257265</param>
    258266</params>
     
    269277<value><string>234</string></value>
    270278<value><string>Anna Tester</string></value>
     279<value><int>2004</int></value>
     280<value><int>100</int></value>
    271281<value><array><data>
    272282<value><string>COURSE1</string></value>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py

    r16392 r16393  
    165165        except (TypeError, ValueError):
    166166            pass
    167         if session in (None, ''):
     167        if session in (None, '',0):
    168168            session= None
    169         if level in (None, ''):
     169        if level in (None, '',0):
    170170            level= None
    171171        try:
     
    186186                        c_ticket.student.matric_number,
    187187                        c_ticket.student.display_fullname,
     188                        c_ticket.student.current_session,
     189                        c_ticket.student.current_level,
    188190                        [c_ticket.code,])
    189191                else:
    190                     hitdict[c_ticket.student.student_id][2].append(
     192                    hitdict[c_ticket.student.student_id][4].append(
    191193                        c_ticket.code,)
    192194        return hitdict
Note: See TracChangeset for help on using the changeset viewer.