From 0a98db04cf89af7247e3b2aedf8337671d087ff5 Mon Sep 17 00:00:00 2001 From: alejandromumo Date: Wed, 2 Aug 2023 14:08:24 +0200 Subject: [PATCH] requests: added moderation actions. --- .../requests/user_moderation/__init__.py | 11 +++++++++++ .../requests/user_moderation/actions.py | 17 +++++++++++++++++ setup.cfg | 3 +++ 3 files changed, 31 insertions(+) create mode 100644 invenio_communities/requests/user_moderation/__init__.py create mode 100644 invenio_communities/requests/user_moderation/actions.py diff --git a/invenio_communities/requests/user_moderation/__init__.py b/invenio_communities/requests/user_moderation/__init__.py new file mode 100644 index 000000000..ef0012f03 --- /dev/null +++ b/invenio_communities/requests/user_moderation/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2023 CERN. +# +# Invenio-communities is free software; you can redistribute it and/or modify +# it under the terms of the MIT License; see LICENSE file for more details. +"""Communities user moderation.""" + +from .actions import remove_communities, restore_communities + +__all__ = ("remove_communities", "restore_communities") diff --git a/invenio_communities/requests/user_moderation/actions.py b/invenio_communities/requests/user_moderation/actions.py new file mode 100644 index 000000000..be36a3bb2 --- /dev/null +++ b/invenio_communities/requests/user_moderation/actions.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2023 CERN. +# +# Invenio-communities is free software; you can redistribute it and/or modify +# it under the terms of the MIT License; see LICENSE file for more details. +"""Communities user moderation actions.""" + + +def remove_communities(user_id, **kwargs): + """Removes communities that belong to a user.""" + pass + + +def restore_communities(user_id, **kwargs): + """Restores communities that belong to a user.""" + pass diff --git a/setup.cfg b/setup.cfg index 2991fd016..55d93db7e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -87,6 +87,9 @@ invenio_i18n.translations = invenio_administration.views = invenio_communities_list = invenio_communities.administration.communities:CommunityListView invenio_communities_details = invenio_communities.administration.communities:CommunityDetailView +invenio_users_resources.moderation.actions = + block = invenio_communities.requests.user_moderation.actions:remove_communities + restore = invenio_communities.requests.user_moderation.actions:restore_communities [build_sphinx] source-dir = docs/