summaryrefslogtreecommitdiffstats
path: root/django/sp_sso/invite/utils.py
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2017-09-25 13:49:09 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2017-09-25 13:49:09 (GMT)
commit8235164ecce89e254b978dbc6403980c062a7c0d (patch)
tree301bfb7a818af8511675c60b5affd3b3b7a50fa0 /django/sp_sso/invite/utils.py
parentd438c5f45477033feb145eae871c3ca509a3901c (diff)
parentd0a6042d3d4b7fd0ce5500621a5f1815dfc70ff5 (diff)
downloadpaul-synchro-8235164ecce89e254b978dbc6403980c062a7c0d.zip
paul-synchro-8235164ecce89e254b978dbc6403980c062a7c0d.tar.gz
paul-synchro-8235164ecce89e254b978dbc6403980c062a7c0d.tar.bz2
Merge branch 'master' of git.entrouvert.org:paul-synchro
Diffstat (limited to 'django/sp_sso/invite/utils.py')
-rw-r--r--django/sp_sso/invite/utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/django/sp_sso/invite/utils.py b/django/sp_sso/invite/utils.py
index 5cc40fd..4f49b39 100644
--- a/django/sp_sso/invite/utils.py
+++ b/django/sp_sso/invite/utils.py
@@ -21,12 +21,21 @@ PASSERELLE_PEOPLE_QUERY = 'http://dir-condorcet.dev.entrouvert.org/ldapquery/con
logger = logging.getLogger('django')
def get_invitaton_attributes_mapping():
+ """ Full copy of the invitation attributes mapping dictionary """
return INVITATION_ATTRIBUTES_MAPPING.copy()
def get_additional_prefilled_fields():
+ """
+ Returns a full copy of the additional fields to be prefilled with the
+ user's fetched attributes.
+ """
return ADDITIONAL_PREFILLED_FIELDS[:]
def do_invite(invitation):
+ """
+ Sends invitation data to the invitation w.c.s. form.
+ Invitations will then be sent as part of the w.c.s. workflow.
+ """
opener = build_opener(HTTPHandler)
# Generate a JSON to bind against the wcs ReST API
form = {}
@@ -48,6 +57,10 @@ def do_invite(invitation):
def get_affectations_from_eppn(eppn):
+ """
+ Returns a tuple (<Institution identifier>, <Researcher unit identifier>)
+ for a given eduPersonPrincipalName (a.k.a. `eppn`)
+ """
if eppn:
try:
ldapquery = urlopen(PASSERELLE_PEOPLE_QUERY)