Skip to content

Commit

Permalink
Merge pull request #112 from ptitloup/ptitloup/get_username
Browse files Browse the repository at this point in the history
add LTI_PROPERTY_LIST_EX and LTI_PROPERTY_USER_USERNAME in settings a…
  • Loading branch information
sdreher authored Feb 13, 2018
2 parents 39e189e + a6dad66 commit b48a717
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lti_provider/lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
from xml.etree import ElementTree as etree


LTI_PROPERTY_LIST_EX = [
'custom_canvas_user_login_id',
'context_title',
'lis_course_offering_sourcedid',
'custom_canvas_api_domain'
]
LTI_PROPERTY_LIST_EX = getattr(settings,
'LTI_PROPERTY_LIST_EX',
[
'custom_canvas_user_login_id',
'context_title',
'lis_course_offering_sourcedid',
'custom_canvas_api_domain'
])

LTI_PROPERTY_USER_USERNAME = getattr(settings,
'LTI_PROPERTY_USER_USERNAME',
'custom_canvas_user_login_id')


class LTI(object):
Expand Down Expand Up @@ -203,7 +209,7 @@ def user_id(self, request):
return request.session.get('user_id', None)

def user_identifier(self, request):
return request.session.get('custom_canvas_user_login_id', None)
return request.session.get(LTI_PROPERTY_USER_USERNAME, None)

def user_roles(self, request): # pylint: disable=no-self-use
"""
Expand Down

0 comments on commit b48a717

Please sign in to comment.