mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-08 20:10:17 +02:00
Merge branch 'group-auto-leave-enhancements' into 'v2.9.x'
Group auto leave enhancements See merge request allianceauth/allianceauth!1369
This commit is contained in:
commit
8b8dcc0127
@ -388,7 +388,7 @@ def group_request_leave(request, group_id):
|
||||
logger.info(f"{request.user} attempted to leave {group} but already has an pending leave request.")
|
||||
messages.warning(request, _("You already have a pending leave request for that group."))
|
||||
return redirect("groupmanagement:groups")
|
||||
if getattr(settings, 'AUTO_LEAVE', False):
|
||||
if getattr(settings, 'GROUPMANAGEMENT_AUTO_LEAVE', False):
|
||||
logger.info(f"{request.user} leaving joinable group {group} due to auto_leave")
|
||||
request_info = request.user.username + ":" + group.name
|
||||
log = RequestLog(request_type=True, group=group, request_info=request_info, action=1, request_actor=request.user)
|
||||
|
@ -41,11 +41,13 @@ Here is a list of available settings for Group Management. They can be configure
|
||||
Note that all settings are optional and the app will use the documented default settings if they are not used.
|
||||
|
||||
```eval_rst
|
||||
+---------------------------------------------+---------------------------------------------------------------------------+------------+
|
||||
| Name | Description | Default |
|
||||
+=============================================+===========================================================================+============+
|
||||
| ``GROUPMANAGEMENT_REQUESTS_NOTIFICATION`` | Send Auth notifications to all group leaders for join and leave requests. | ``False`` |
|
||||
+---------------------------------------------+---------------------------------------------------------------------------+------------+
|
||||
+---------------------------------------------+-------------------------------------------------------------------------------------------+------------+
|
||||
| Name | Description | Default |
|
||||
+=============================================+===========================================================================================+============+
|
||||
| ``GROUPMANAGEMENT_AUTO_LEAVE`` | Group members can leave their group without needing confirmation from their group leaders | ``False`` |
|
||||
+---------------------------------------------+-------------------------------------------------------------------------------------------+------------+
|
||||
| ``GROUPMANAGEMENT_REQUESTS_NOTIFICATION`` | Send Auth notifications to all group leaders for join and leave requests. | ``False`` |
|
||||
+---------------------------------------------+-------------------------------------------------------------------------------------------+------------+
|
||||
```
|
||||
|
||||
## Permissions
|
||||
|
@ -48,12 +48,3 @@ When a user loses this permission, they will be removed from all groups _except_
|
||||
.. note::
|
||||
By default, the ``groupmanagement.request_groups`` permission is applied to the ``Member`` group. In most instances this, and perhaps adding it to the ``Blue`` group, should be all that is ever needed. It is unsupported and NOT advisable to apply this permission to a public group. See #697 for more information.
|
||||
```
|
||||
|
||||
### Auto Leave
|
||||
|
||||
By default in AA, Both requests and leaves for non-open groups must be approved by a group manager. If you wish to allow users to leave groups without requiring approvals, add the following lines to your `local.py`
|
||||
|
||||
```python
|
||||
## Allows users to freely leave groups without requiring approval.
|
||||
AUTO_LEAVE = True
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user