From 9b4bef0050a9cb4d7ede6d3c6313d6c4ec69488b Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 29 Dec 2014 15:22:52 +0100 Subject: [PATCH] add new task delete_ldap_group --- docs/changelog.rst | 2 ++ docs/code.rst | 1 + gnuviechadmin/osusers/tasks.py | 14 +++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index acc838a..5ab9cd9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :feature:`-` add new task :py:func:`osusers.tasks.delete_ldap_group` (needs + gvaldap >= 0.2.0 on the LDAP side) * :feature:`-` add a `customer` field to :py:class:`osusers.models.User` * :feature:`-` allow empty password input in :py:class:`osusers.admin.UserCreationForm` to allow generated passwords for diff --git a/docs/code.rst b/docs/code.rst index 14c6e08..db64b7f 100644 --- a/docs/code.rst +++ b/docs/code.rst @@ -143,6 +143,7 @@ provides some functionality that is common to all gnuviechadmin subprojects. .. autotask:: osusers.tasks.delete_file_mail_userdir .. autotask:: osusers.tasks.delete_file_mailbox .. autotask:: osusers.tasks.delete_file_sftp_userdir +.. autotask:: osusers.tasks.delete_ldap_group .. autotask:: osusers.tasks.delete_ldap_group_if_empty .. autotask:: osusers.tasks.delete_ldap_user .. autotask:: osusers.tasks.remove_ldap_user_from_group diff --git a/gnuviechadmin/osusers/tasks.py b/gnuviechadmin/osusers/tasks.py index ce250ab..a14265e 100644 --- a/gnuviechadmin/osusers/tasks.py +++ b/gnuviechadmin/osusers/tasks.py @@ -98,7 +98,19 @@ def delete_ldap_user(username): @shared_task def delete_ldap_group_if_empty(groupname): """ - This task deletes the given group. + This task deletes the given group if it is empty. + + :param str groupname: the group name + :return: True if the user has been deleted, False otherwise + :rtype: boolean + + """ + + +@shared_task +def delete_ldap_group(groupname): + """ + This taks deletes the given group. :param str groupname: the group name :return: True if the user has been deleted, False otherwise