Changeset 16112 for main/waeup.kofa


Ignore:
Timestamp:
9 Jun 2020, 06:40:21 (4 years ago)
Author:
Henrik Bettermann
Message:

Extend webservice.

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

    r16110 r16112  
    262262        result = server.get_grad_student('123', 'aa@aa.ng')
    263263        self.assertEqual(result,
    264             [True, False])
     264            [True, False, False])
    265265        REQUEST_XML = """\
    266266<?xml version="1.0"?>
     
    283283<value><array><data>
    284284<value><boolean>1</boolean></value>
     285<value><boolean>0</boolean></value>
    285286<value><boolean>0</boolean></value>
    286287</data></array></value>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py

    r16110 r16112  
    2424from waeup.kofa.interfaces import (
    2525    IUniversity, IExtFileStore, IFileStoreNameChooser, IKofaUtils,
    26     GRADUATED)
     26    GRADUATED, TRANSREL)
    2727from waeup.kofa.utils.helpers import get_fileformat, to_timezone
    2828from waeup.kofa.students.catalog import StudentsQuery
     
    166166    @grok.require('waeup.Public')
    167167    def get_grad_student(self, identifier=None, email=None):
    168         """Does student record exist and is graduated student with correct
    169         email address?
     168        """Check if student record exist, check email address and
     169        retrieve registration state.
    170170        """
    171171        students = self.context['students']
     
    175175        correct_email = False
    176176        has_graduated = False
     177        transcript_released = False
    177178        if student.email == email:
    178179            correct_email = True
    179180        if student.state == GRADUATED:
    180181            has_graduated = True
    181         return [correct_email, has_graduated]
     182        if student.state == TRANSREL:
     183            transcript_released = True
     184        return [correct_email, has_graduated, transcript_released]
    182185
    183186    @grok.require('waeup.xmlrpc')
Note: See TracChangeset for help on using the changeset viewer.