Revision faa26af8 logic/shibboleth.py

b/logic/shibboleth.py
18 18
    SIB_GR_EDU_PERSON_UNDERGRADUATE_BRANCH = "grEduPersonUndergraduateBranch"
19 19

  
20 20
class NoUniqueToken(object):
21

  
22
    def __init__(self, msg):
23
        self.msg = msg
24
    
25
    pass
26

  
27
class NoRealName(object):
28

  
29
    def __init__(self, msg):
30
        self.msg = msg
31

  
21 32
    pass
22 33

  
23 34
def register_shibboleth_user(tokens):
......
39 50
    unq = tokens.get(Tokens.SIB_EDU_PERSON_PRINCIPAL_NAME)
40 51

  
41 52
    if unq is None:
42
        raise NoUniqueToken
53
        raise NoUniqueToken("Authentication does not return a unique token")
54

  
55
    if realname is None:
56
        raise NoRealName("Authentication does not return the user's name")
43 57

  
44 58
    if is_student:
45 59
        users.register_student(realname, '' ,unq)

Also available in: Unified diff