Project

General

Profile

« Previous | Next » 

Revision cb408fc1

Added by Serghei Mihai over 9 years ago

handling case when user declines to share scopes (#6553)

View differences:

ckanext/ozwillo_pyoidc/plugin.py
129 129
        g = model.Group.get(session['organization_id'])
130 130
        client = Clients.get(g)
131 131
        userinfo = client.callback(request.GET)
132
        locale = None
132 133
        log.info('Received userinfo: %s' % userinfo)
133
        userobj = model.User.get(userinfo['sub'])
134
        locale = userinfo.get('locale')
135
        if '-' in locale:
136
            locale, country = locale.split('-')
137 134

  
138
        if userobj:
135
        if 'sub' in userinfo:
136
            locale = userinfo.get('locale', '')
137
            if '-' in locale:
138
                locale, country = locale.split('-')
139

  
140
            userobj = model.User.get(userinfo['sub'])
139 141
            if 'given_name' in userinfo:
140 142
                userobj.fullname = userinfo['given_name']
141 143
            if 'family_name' in userinfo:

Also available in: Unified diff