Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weekly release 2024-11-04 #140

Merged
merged 18 commits into from
Nov 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: standardise returns field
alycejenni committed Oct 31, 2024
commit b19a66603522995d5b7fdf304d74741cbf34be17
2 changes: 1 addition & 1 deletion ckanext/ldap/lib/utils.py
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 4 additions & 4 deletions ckanext/ldap/routes/_helpers.py
Original file line number Diff line number Diff line change
@@ -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)
@@ -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]
@@ -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'])
@@ -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'],