Skip to content

Commit

Permalink
docs: standardise returns field
Browse files Browse the repository at this point in the history
  • Loading branch information
alycejenni committed Oct 31, 2024
1 parent e15a977 commit b19a666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ckanext/ldap/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def init_tables() -> bool:
Initialises the database for the LDAP plugin. If the tables already exist then
nothing happens.
:return: True if the database was modified, False if not
:returns: True if the database was modified, False if not
"""
if not ldap_user_table.exists():
ldap_user_table.create()
Expand Down
8 changes: 4 additions & 4 deletions ckanext/ldap/routes/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def ckan_user_exists(user_name):
Check if a CKAN user name exists, and if that user is an LDAP user.
:param user_name: User name to check
:return: Dictionary defining 'exists' and 'ldap'.
:returns: Dictionary defining 'exists' and 'ldap'.
"""
try:
user = get_user_dict(user_name)
Expand All @@ -132,7 +132,7 @@ def get_unique_user_name(base_name):
Create a unique, valid, non existent user name from the given base name.
:param base_name: Base name
:return: A valid user name not currently in use based on base_name
:returns: A valid user name not currently in use based on base_name
"""
base_name = re.sub('[^-a-z0-9_]', '_', base_name.lower())
base_name = base_name[0:100]
Expand All @@ -153,7 +153,7 @@ def get_or_create_ldap_user(ldap_user_dict):
Get or create a CKAN user from the data returned by the LDAP server.
:param ldap_user_dict: Dictionary as returned by _find_ldap_user
:return: The CKAN username of an existing user
:returns: The CKAN username of an existing user
"""
# Look for existing user, and if found return it.
ldap_user = LdapUser.by_ldap_id(ldap_user_dict['username'])
Expand Down Expand Up @@ -232,7 +232,7 @@ def check_ldap_password(cn, password):
:param cn: Common name to log on
:param password: Password for cn
:return: True on success, False on failure
:returns: True on success, False on failure
"""
cnx = ldap.initialize(
toolkit.config['ckanext.ldap.uri'],
Expand Down

0 comments on commit b19a666

Please sign in to comment.