AA Inactivity
raw JSON → 2.0.1 verified Mon Apr 27 auth: no python
Activity monitoring app for Alliance Auth, tracking user inactivity. Current version 2.0.1, released with compatibility for Django 3.2+ and Python 3.8+. Maintenance updates as needed.
pip install aa-inactivity Common errors
error ModuleNotFoundError: No module named 'aa_inactivity' ↓
cause Package not installed or virtual environment not activated.
fix
Run
pip install aa-inactivity and ensure your venv is active. error ImportError: cannot import name 'InactivityRecord' from 'aa_inactivity.models' ↓
cause Model renamed in v2.0.0 from InactivityRecord to Inactivity.
fix
Change import to
from aa_inactivity.models import Inactivity. error django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. ↓
cause Model accessed before Django setup, often in settings or admin autodiscover.
fix
Wrap imports in
from django.apps import apps; apps.get_model(...) or defer usage. Warnings
gotcha In v2.0.0+, the model `InactivityRecord` was renamed to `Inactivity`. If you have old references or migrations referencing `InactivityRecord`, they will raise ImportError. ↓
fix Update imports to `from aa_inactivity.models import Inactivity` and regenerate migrations.
gotcha The app requires Alliance Auth >=2.9.0. Installing with an older AA version causes import or API mismatches. ↓
fix Upgrade AA to 2.9.0+ before installing aa-inactivity.
deprecated The setting `AA_INACTIVITY_ENABLED_CORPORATIONS` (list of corp IDs) is deprecated in v1.x but still supported via fallback. Use `MonitoredCorporation` model instead. ↓
fix Migrate each corporation to a `MonitoredCorporation` object.
Imports
- Inactivity wrong
from aa_inactivity.models import InactivityRecordcorrectfrom aa_inactivity.models import Inactivity - MonitoredCorporation
from aa_inactivity.models import MonitoredCorporation
Quickstart
from aa_inactivity.models import Inactivity, MonitoredCorporation
from django.contrib.auth.models import User
# Example: create a monitored corporation
corp = MonitoredCorporation.objects.create(
corporation_id=123456,
corporation_name='Test Corp',
enable_monitoring=True
)
print('Monitored corporation created:', corp)
# Check user inactivity status
user = User.objects.get(pk=1)
inactivity, created = Inactivity.objects.get_or_create(user=user)
print('Inactivity record:', inactivity.is_inactive)