Skip to main content

Alliance Auth - Leave of Absence (aa-loa)

PyPI version Python versions Tests

A complete Leave of Absence (LOA) management module for Alliance Auth. This module allows members to declare periods of absence so that leadership is aware of their inactivity, while seamlessly integrating with other Alliance Auth features (like Discord and Activity Trackers) to prevent accidental purges.

Features

  • Player Dashboard: Easy-to-use form for players to submit a start date, end date, and an optional reason. Players can also view their past LOAs, and cancel/revoke an active LOA if they return early.
  • HR Dashboard: A dedicated view for Directors/HR to see a live table of all active and upcoming LOAs in the alliance.
  • Proxy Submission: Directors can submit an LOA on behalf of a member who might be unable to access a PC (e.g. emergencies).
  • Discord Role Sync: Assigns members to a specific Django Group (e.g., [On Leave]) when their LOA becomes active. Alliance Auth will automatically sync this to Discord, TS, or Mumble.
  • Purge Protection: Because the member is in the [On Leave] group, audit modules (like aa-inactives or opcalendar) can simply whitelist this group to exempt the member from activity purges.
  • Webhooks: Automatically posts a Discord Embed to a webhook URL whenever an LOA is submitted.
  • Welcome Back Notification: A Celery task automatically removes the member from the LOA group when the end date passes, and sends a "Welcome Back" Alliance Auth notification.

🤖 Optional: Discord Bot Integration (aa-discordbot)

While aa-loa works perfectly fine on its own, it integrates natively with aa-discordbot. If your alliance has aa-discordbot installed, the internal Alliance Auth notifications generated by this module will automatically be forwarded as Direct Messages (DMs) on Discord to the user. This applies to:

  • 📩 The "Welcome Back" notification when an LOA automatically expires.
  • 🛑 The "Cancellation" notification when HR manually cancels a player's LOA.

Installation

1. Install the Python Package

Activate your Alliance Auth virtual environment and install the package:

pip install -e /path/to/aa-loa/

2. Update Alliance Auth Settings

Open your myauth/settings/local.py file and add 'aa_loa' to your INSTALLED_APPS:

INSTALLED_APPS += [
    # ... other apps
    'aa_loa',
]

3. Run Database Migrations

Run the migrations to create the database tables:

python manage.py makemigrations aa_loa
python manage.py migrate

4. Restart Services

Restart your Alliance Auth web service and Celery workers so they pick up the new code and background tasks:

sudo systemctl restart supervisor

(Or restart the specific services depending on your hosting environment).


Configuration

1. Setup the LOA Group

  1. Go to the Django Admin Panel (/admin/).
  2. Navigate to Authentication and Authorization -> Groups and create a new group (e.g., On Leave).
    • Optional: Configure this group in your Discord/TS services to map to a specific [On Leave] Discord Role.
  3. Navigate to Leave of Absence Configuration -> LOA Config.
  4. Add a new configuration row.
  5. Select the On Leave group you just created.
  6. (Optional) Paste a Discord Webhook URL if you want real-time notifications in an HR channel when LOAs are submitted.

2. Permissions

Assign the following permissions to the appropriate states or groups in Alliance Auth:

Permission Code Django Admin Name Description
aa_loa.basic_access Leave of Absence | leave of absence | Can access the LOA module Grants access to the LOA module for normal members. Allows them to submit and manage their own LOAs.
aa_loa.manage_loa Leave of Absence | leave of absence | Can manage LOAs for other users and view HR dashboard Grants access to the HR Dashboard. Allows users to view all LOAs and submit proxy LOAs for other members.

3. Setup the Celery Periodic Task

To ensure LOA groups are automatically assigned and removed every night, you need to configure the daily Celery task in your local.py settings file.

Open your myauth/settings/local.py and add the following to your CELERYBEAT_SCHEDULE dictionary:

from celery.schedules import crontab

CELERYBEAT_SCHEDULE['aa_loa_sync_groups'] = {
    'task': 'aa_loa.tasks.sync_loa_groups',
    'schedule': crontab(minute='0', hour='0'),
}

Restart your celery worker (sudo systemctl restart supervisor) and the system will automatically activate/deactivate LOAs every day at midnight!

Language of Discord messages

The LOA webhook post uses the language chosen on the HR dashboard under Discord Messages; when none is chosen, the installation default applies. Notifications and direct messages to members use each member's own Alliance Auth language. Set the default in myauth/settings/local.py (it falls back to LANGUAGE_CODE):

DISCORD_MESSAGE_LANGUAGE = "en"  # or e.g. "nl-nl"

Metadata

Release files for aa-loa 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aa-loa 0.1.0
File Size Uploaded Provenance Actions
aa_loa-0.1.0.tar.gz 15.9 kB With provenance Details for aa_loa-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aa-loa 0.1.0
File Interpreter ABI Platform Actions
aa_loa-0.1.0-py3-none-any.whl Python 3 none any Details for aa_loa-0.1.0-py3-none-any.whl

Total release size: 40.1 kB

Release files / aa_loa-0.1.0.tar.gz

Download URL aa_loa-0.1.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e2798eb9fa7dae196877e96a64f0e3e971c2776f765dae9147879a90e450a1c7
BLAKE2b-256 checksum
How to use checksums
91e8b01efafc99844acc6a7d790fb0d7f13c7b1add0e7ecb25ac614647fd8130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / aa_loa-0.1.0-py3-none-any.whl

Download URL aa_loa-0.1.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acd739e2cd51ed5984edde0210aacd21332e98e45f07454bc394d86b79e033a0
BLAKE2b-256 checksum
How to use checksums
dcba5a846649a43d9d2d2f86a98627dd6d1ed85d20b4252ac72451de38aaea31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for aa-loa 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aa_loa-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page