aa-structures 2.8.0__tar.gz → 2.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aa_structures-2.8.0 → aa_structures-2.9.1}/PKG-INFO +2 -2
- {aa_structures-2.8.0 → aa_structures-2.9.1}/README.md +1 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/__init__.py +1 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/admin.py +3 -3
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/app_settings.py +88 -69
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/billing_embeds.py +40 -7
- aa_structures-2.8.0/structures/core/notification_embeds/character_embeds.py → aa_structures-2.9.1/structures/core/notification_embeds/corporate_embeds.py +23 -13
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/main.py +76 -38
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/moonmining_embeds.py +12 -17
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/orbital_embeds.py +3 -8
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/sov_embeds.py +21 -19
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/structures_embeds.py +19 -26
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/tower_embeds.py +2 -2
- aa_structures-2.9.1/structures/core/notification_embeds/war_embeds.py +413 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_types.py +63 -44
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/forms.py +0 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/helpers.py +13 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/de/LC_MESSAGES/django.po +488 -302
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/django.pot +494 -308
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/en/LC_MESSAGES/django.po +494 -308
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/es/LC_MESSAGES/django.po +488 -302
- {aa_structures-2.8.0/structures/locale/it_IT → aa_structures-2.9.1/structures/locale/fr_FR}/LC_MESSAGES/django.po +494 -308
- {aa_structures-2.8.0/structures/locale/fr_FR → aa_structures-2.9.1/structures/locale/it_IT}/LC_MESSAGES/django.po +494 -308
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ja/LC_MESSAGES/django.po +494 -308
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ko_KR/LC_MESSAGES/django.po +488 -302
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ru/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ru/LC_MESSAGES/django.po +532 -349
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/uk/LC_MESSAGES/django.po +488 -302
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/zh_Hans/LC_MESSAGES/django.po +488 -302
- aa_structures-2.9.1/structures/migrations/0005_add_notification_types.py +135 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/eveuniverse.py +0 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/notifications.py +1 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/owners.py +3 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/notification_embeds/test_main.py +29 -27
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_notification_structuretimers.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_notifications_timerboard.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_serializers.py +4 -2
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_starbases.py +4 -2
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/integration/test_tasks.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/integration/test_views.py +6 -3
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_eveuniverse.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_notifications_1.py +16 -21
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_notifications_2.py +4 -2
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_notifications_3.py +6 -3
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_notifications_discord.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_owners_1.py +28 -4
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_owners_2.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_owners_3.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_owners_4.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_owners_5.py +8 -4
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/test_structures.py +16 -8
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/test_helpers.py +23 -3
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/test_managers_1.py +16 -8
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/test_managers_2.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/test_tasks.py +12 -6
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/entities.json +150 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/helpers.py +1 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/views/test_public.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/views/test_statistics.py +2 -1
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/views/test_structures.py +20 -10
- aa_structures-2.8.0/structures/core/notification_embeds/war_embeds.py +0 -207
- {aa_structures-2.8.0 → aa_structures-2.9.1}/LICENSE +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/pyproject.toml +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/apps.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/auth_hooks.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/constants.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/helpers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_timers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/serializers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/sovereignty.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/starbases.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/de/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/en/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/es/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/it_IT/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ja/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/ko_KR/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/uk/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/management/commands/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/management/commands/structures_load_eve.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/management/commands/structures_preload_eveuniverse.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/management/commands/structures_update_poco_planets.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/managers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/migrations/0001_initial_new.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/migrations/0002_remove_eveuniverse_relation_names.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/migrations/0003_add_localization_and_unique_key.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/migrations/0004_improve_localization.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/migrations/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/structures_1.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/models/structures_2.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/providers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/css/global.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/css/main.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/css/public.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/css/statistics.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/css/structures.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/bars-rotate-fade-black-36.svg +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/bars-rotate-fade-white-36.svg +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/eve_symbol_128.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/0h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/0l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/0m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/0r.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/0s.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/1h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/1l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/1m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/1r.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/2h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/2l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/2m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/2r.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/3h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/3l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/3m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/3r.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/4h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/4l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/4m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/4s.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/5h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/5l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/5m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/5s.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/6h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/6l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/6m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/7h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/7l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/7m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/8h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/8l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/8m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/blank.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/circle.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/dustwheel.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/h.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/l.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/m.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/noship.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/r.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/tyrannis.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/tyrannis_blue.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/tyrannis_darkred.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/tyrannis_default.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/panel/tyrannis_revelations.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/img/structures_logo.png +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/js/global.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/js/public.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/js/statistics.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/js/structures.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/vendor/datatables/plugins/dataTables.rowGroup.min.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/vendor/datatables/plugins/datetime.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/vendor/datatables/plugins/filterDropDown.min.js +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/vendor/datatables/plugins/rowGroup.bootstrap.min.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/static/structures/vendor/datatables/plugins/rowGroup.dataTables.min.css +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tasks.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/base.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/fitting_assets.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/fitting_gfx.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/poco_details.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/starbase_detail.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/structure_details.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/tab_general_detail.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/modals/tab_services_detail.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/menu.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/public/poco_list.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/statistics/structure_summary.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/structures/active_tags.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/structures/jump_gates_list.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/structures/poco_list.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/structures/starbase_list.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/partials/structures/structure_list.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/public.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/statistics.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/structures.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/templatetags/detail_title.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/templatetags/list_asset.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/templatetags/list_item.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/templatetags/list_tax_item.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templates/structures/templatetags/list_title.html +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templatetags/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/templatetags/structures.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/notification_embeds/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/notification_embeds/test_helpers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_notification_types.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/core/test_sovereignty.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/integration/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/models/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/test_admin.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/create_eveuniverse.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/esi_data.json +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/eveuniverse.json +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/factories.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/generate_notifications.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/generate_notifications_2.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/generate_structures.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/load_eveuniverse.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/tasks_loadtest.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/testdata/test_generate_structures.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/views/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/tests/views/utils.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/urls.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/views/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/views/common.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/views/public.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/views/statistics.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/views/structures.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/core.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/managers.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/models.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/tests/__init__.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/tests/test_core.py +0 -0
- {aa_structures-2.8.0 → aa_structures-2.9.1}/structures/webhooks/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aa-structures
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.9.1
|
4
4
|
Summary: App for managing Eve Online structures with Alliance Auth.
|
5
5
|
Author-email: Erik Kalkoken <kalkoken87@gmail.com>
|
6
6
|
Requires-Python: >=3.8
|
@@ -106,7 +106,7 @@ This is an example for a notification posted on Discord:
|
|
106
106
|
|
107
107
|

|
108
108
|
|
109
|
-
##
|
109
|
+
## Documentation
|
110
110
|
|
111
111
|
Please see the [operation manual](https://aa-structures.readthedocs.io/en/latest/operations.html#installation) for the installation guide.
|
112
112
|
|
@@ -70,6 +70,6 @@ This is an example for a notification posted on Discord:
|
|
70
70
|
|
71
71
|

|
72
72
|
|
73
|
-
##
|
73
|
+
## Documentation
|
74
74
|
|
75
75
|
Please see the [operation manual](https://aa-structures.readthedocs.io/en/latest/operations.html#installation) for the installation guide.
|
@@ -1040,9 +1040,9 @@ class WebhookAdmin(admin.ModelAdmin):
|
|
1040
1040
|
|
1041
1041
|
def get_form(self, *args, **kwargs):
|
1042
1042
|
form = super().get_form(*args, **kwargs)
|
1043
|
-
form.base_fields[
|
1044
|
-
|
1045
|
-
|
1043
|
+
form.base_fields["notification_types"].choices = sorted(
|
1044
|
+
NotificationType.choices_enabled(), key=lambda k: k[1]
|
1045
|
+
)
|
1046
1046
|
return form
|
1047
1047
|
|
1048
1048
|
def get_queryset(self, request):
|
@@ -2,119 +2,157 @@
|
|
2
2
|
|
3
3
|
from app_utils.app_settings import clean_setting
|
4
4
|
|
5
|
-
# Whether to automatically add timers for certain notifications
|
6
|
-
# on the timerboard (will have no effect if aa-timerboard app is not installed)
|
7
5
|
STRUCTURES_ADD_TIMERS = clean_setting("STRUCTURES_ADD_TIMERS", True)
|
6
|
+
"""Whether to automatically add timers for certain notifications on the timerboard
|
7
|
+
(will have no effect if aa-timerboard app is not installed).
|
8
|
+
|
9
|
+
Will create timers from anchoring, lost shield and lost armor notifications.
|
10
|
+
"""
|
8
11
|
|
9
|
-
# whether admins will get notifications about import events like
|
10
|
-
# when someone adds a structure owner
|
11
12
|
STRUCTURES_ADMIN_NOTIFICATIONS_ENABLED = clean_setting(
|
12
13
|
"STRUCTURES_ADMIN_NOTIFICATIONS_ENABLED", True
|
13
14
|
)
|
15
|
+
"""Whether admins will get notifications about import events
|
16
|
+
like when someone adds a structure owner and when services for an owner are down.
|
17
|
+
"""
|
14
18
|
|
15
|
-
# Sets the default language to be used in case no language can be determined
|
16
|
-
# e.g. this language will be used when creating timers
|
17
|
-
# Please use the language codes as defined in the base.py settings file
|
18
19
|
STRUCTURES_DEFAULT_LANGUAGE = clean_setting("STRUCTURES_DEFAULT_LANGUAGE", "en")
|
20
|
+
"""Sets the default language to be used in case no language can be determined
|
21
|
+
e.g. this language will be used when creating timers
|
22
|
+
Please use the language codes as defined in the base.py settings file.
|
23
|
+
"""
|
19
24
|
|
20
|
-
# whether the structure list has default tags filter enabled by default
|
21
25
|
STRUCTURES_DEFAULT_TAGS_FILTER_ENABLED = clean_setting(
|
22
26
|
"STRUCTURES_DEFAULT_TAGS_FILTER_ENABLED", False
|
23
27
|
)
|
28
|
+
"""Whether the structure list has default tags filter enabled by default."""
|
24
29
|
|
25
|
-
# Enables features for developers
|
26
|
-
# e.g. write access to all models in admin and writing raw data received from ESI
|
27
|
-
# UNDOCUMENTED SETTING
|
28
30
|
STRUCTURES_DEVELOPER_MODE = clean_setting("STRUCTURES_DEVELOPER_MODE", False)
|
31
|
+
"""Enables features for developers e.g. write access to all models in admin
|
32
|
+
and writing raw data received from ESI.
|
33
|
+
|
34
|
+
:meta private:
|
35
|
+
"""
|
36
|
+
|
37
|
+
STRUCTURES_DEFAULT_PAGE_LENGTH = clean_setting("STRUCTURES_DEFAULT_PAGE_LENGTH", 10)
|
38
|
+
"""Default page size for structure list.
|
39
|
+
Must be an integer value from the current options as seen in the app.
|
40
|
+
"""
|
29
41
|
|
30
|
-
# Whether the customs offices feature is active
|
31
42
|
STRUCTURES_FEATURE_CUSTOMS_OFFICES = clean_setting(
|
32
43
|
"STRUCTURES_FEATURE_CUSTOMS_OFFICES", True
|
33
44
|
)
|
45
|
+
"""Enable / disable custom offices feature."""
|
46
|
+
|
47
|
+
STRUCTURES_FEATURE_REFUELED_NOTIFICATIONS = clean_setting(
|
48
|
+
"STRUCTURES_FEATURE_REFUELED_NOTIFICATIONS", True
|
49
|
+
)
|
50
|
+
"""Enable / disable refueled notifications feature."""
|
34
51
|
|
35
|
-
# Whether the starbases / POSes feature is active
|
36
52
|
STRUCTURES_FEATURE_STARBASES = clean_setting("STRUCTURES_FEATURE_STARBASES", True)
|
53
|
+
"""Enable / disable starbases feature."""
|
54
|
+
|
55
|
+
STRUCTURES_ESI_DIRECTOR_ERROR_MAX_RETRIES = clean_setting(
|
56
|
+
"STRUCTURES_ESI_DIRECTOR_ERROR_MAX_RETRIES", 3
|
57
|
+
)
|
58
|
+
"""Max retries before a character is deleted when ESI claims the character
|
59
|
+
is not a director (Since this sometimes is reported wrongly by ESI).
|
60
|
+
"""
|
61
|
+
|
62
|
+
STRUCTURES_ESI_TIMEOUT_ENABLED = clean_setting("STRUCTURES_ESI_TIMEOUT_ENABLED", True)
|
63
|
+
"""Whether ESI timeout is enabled."""
|
37
64
|
|
38
65
|
|
39
|
-
# defines after how many hours a notification becomes stale
|
40
|
-
# stale notification will no longer be sent automatically
|
41
66
|
STRUCTURES_HOURS_UNTIL_STALE_NOTIFICATION = clean_setting(
|
42
67
|
"STRUCTURES_HOURS_UNTIL_STALE_NOTIFICATION", 24
|
43
68
|
)
|
69
|
+
"""Defines after how many hours a notification becomes stale.
|
70
|
+
Stale notification will no longer be sent automatically.
|
71
|
+
"""
|
44
72
|
|
45
|
-
# whether to create / remove timers from moon extraction notifications
|
46
73
|
STRUCTURES_MOON_EXTRACTION_TIMERS_ENABLED = clean_setting(
|
47
74
|
"STRUCTURES_MOON_EXTRACTION_TIMERS_ENABLED", True
|
48
75
|
)
|
76
|
+
"""Whether to create / remove timers from moon extraction notifications."""
|
49
77
|
|
50
|
-
# Max number of retries for sending a notification if an error occurred
|
51
|
-
# e.g. rate limiting
|
52
78
|
STRUCTURES_NOTIFICATION_MAX_RETRIES = clean_setting(
|
53
79
|
"STRUCTURES_NOTIFICATION_MAX_RETRIES", 3
|
54
80
|
)
|
81
|
+
"""Max number of retries for sending a notification
|
82
|
+
if an error occurred e.g. rate limiting.
|
83
|
+
"""
|
84
|
+
|
85
|
+
STRUCTURES_NOTIFICATION_SET_AVATAR = clean_setting(
|
86
|
+
"STRUCTURES_NOTIFICATION_SET_AVATAR", True
|
87
|
+
)
|
88
|
+
"""Wether structures sets the name and avatar icon of a webhook.
|
89
|
+
When ``False`` the webhook will use it's own values as set on the platform.
|
90
|
+
"""
|
91
|
+
|
92
|
+
STRUCTURES_NOTIFICATION_SHOW_MOON_ORE = clean_setting(
|
93
|
+
"STRUCTURES_NOTIFICATION_SHOW_MOON_ORE", True
|
94
|
+
)
|
95
|
+
"""Wether ore details are shown on moon timers."""
|
96
|
+
|
55
97
|
|
56
|
-
# Max time in minutes since last successful notification sync
|
57
|
-
# before service is reported as down
|
58
98
|
STRUCTURES_NOTIFICATION_SYNC_GRACE_MINUTES = clean_setting(
|
59
99
|
"STRUCTURES_NOTIFICATION_SYNC_GRACE_MINUTES", 40
|
60
100
|
)
|
101
|
+
"""Max time in minutes since last successful notification sync
|
102
|
+
before service is reported as down.
|
103
|
+
"""
|
61
104
|
|
62
|
-
# Default wait time in seconds before retrying to send a notification
|
63
|
-
# to Discord after an error occurred
|
64
105
|
STRUCTURES_NOTIFICATION_WAIT_SEC = clean_setting("STRUCTURES_NOTIFICATION_WAIT_SEC", 5)
|
106
|
+
"""Default wait time in seconds before retrying to send a notification
|
107
|
+
to Discord after an error occurred.
|
108
|
+
"""
|
65
109
|
|
66
|
-
# Enables archiving of all notifications received from ESI to files
|
67
|
-
# notifications will by stored into one continuous file per corporations
|
68
|
-
# UNDOCUMENTED SETTING
|
69
110
|
STRUCTURES_NOTIFICATIONS_ARCHIVING_ENABLED = clean_setting(
|
70
111
|
"STRUCTURES_NOTIFICATIONS_ARCHIVING_ENABLED", False
|
71
112
|
)
|
113
|
+
"""Enables archiving of all notifications received from ESI to files
|
114
|
+
notifications will by stored into one continuous file per corporations.
|
72
115
|
|
73
|
-
|
74
|
-
|
75
|
-
STRUCTURES_NOTIFICATION_SET_AVATAR = clean_setting(
|
76
|
-
"STRUCTURES_NOTIFICATION_SET_AVATAR", True
|
77
|
-
)
|
116
|
+
:meta private:
|
117
|
+
"""
|
78
118
|
|
79
|
-
|
80
|
-
|
81
|
-
"STRUCTURES_NOTIFICATION_SHOW_MOON_ORE", True
|
82
|
-
)
|
119
|
+
STRUCTURES_PAGING_ENABLED = clean_setting("STRUCTURES_PAGING_ENABLED", True)
|
120
|
+
"""Whether paging is enabled for the structure list"""
|
83
121
|
|
84
|
-
# how to handle notification about NPC attacks
|
85
122
|
STRUCTURES_REPORT_NPC_ATTACKS = clean_setting("STRUCTURES_REPORT_NPC_ATTACKS", True)
|
123
|
+
"""Enable / disable sending notifications for attacks by NPCs
|
124
|
+
(structure reinforcements are still reported).
|
125
|
+
"""
|
86
126
|
|
87
|
-
# whether fuel expires in structures browser is shown as absolute value
|
88
127
|
STRUCTURES_SHOW_FUEL_EXPIRES_RELATIVE = clean_setting(
|
89
128
|
"STRUCTURES_SHOW_FUEL_EXPIRES_RELATIVE", True
|
90
129
|
)
|
130
|
+
"""Whether fuel expires in structures browser is shown as absolute value."""
|
91
131
|
|
92
|
-
# Whether to show the jump gates tab
|
93
132
|
STRUCTURES_SHOW_JUMP_GATES = clean_setting("STRUCTURES_SHOW_JUMP_GATES", True)
|
133
|
+
"""Whether to show the jump gates tab."""
|
94
134
|
|
95
|
-
# Max time in minutes since last successful structures sync
|
96
|
-
# before service is reported as down
|
97
135
|
STRUCTURES_STRUCTURE_SYNC_GRACE_MINUTES = clean_setting(
|
98
136
|
"STRUCTURES_STRUCTURE_SYNC_GRACE_MINUTES", 120
|
99
137
|
)
|
138
|
+
"""Max time in minutes since last successful structures sync
|
139
|
+
before service is reported as down.
|
140
|
+
"""
|
100
141
|
|
101
|
-
# Hard timeout for tasks in seconds to reduce task accumulation during outages
|
102
142
|
STRUCTURES_TASKS_TIME_LIMIT = clean_setting("STRUCTURES_TASKS_TIME_LIMIT", 7200)
|
143
|
+
"""Hard timeout for tasks in seconds to reduce task accumulation during outages."""
|
103
144
|
|
104
|
-
# whether created timers are corp restricted on the timerboard
|
105
145
|
STRUCTURES_TIMERS_ARE_CORP_RESTRICTED = clean_setting(
|
106
146
|
"STRUCTURES_TIMERS_ARE_CORP_RESTRICTED", False
|
107
147
|
)
|
148
|
+
"""Whether created timers are corp restricted on the timerboard."""
|
108
149
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
# Wether paging is enabled for the structure list
|
117
|
-
STRUCTURES_PAGING_ENABLED = clean_setting("STRUCTURES_PAGING_ENABLED", True)
|
150
|
+
STRUCTURES_NOTIFICATION_DISABLE_ESI_FUEL_ALERTS = clean_setting(
|
151
|
+
"STRUCTURES_NOTIFICATION_DISABLE_ESI_FUEL_ALERTS", False
|
152
|
+
)
|
153
|
+
"""This allows you to turn off ESI fuel alert notifications
|
154
|
+
to use the Structure's generated fuel notifications exclusively.
|
155
|
+
"""
|
118
156
|
|
119
157
|
# INTERNAL SETTINGS
|
120
158
|
|
@@ -143,22 +181,3 @@ STRUCTURES_NOTIFICATION_TURNAROUND_MAX_VALID = clean_setting(
|
|
143
181
|
STRUCTURES_NOTIFY_THROTTLED_TIMEOUT = clean_setting(
|
144
182
|
"STRUCTURES_NOTIFY_THROTTLED_TIMEOUT", 86400
|
145
183
|
)
|
146
|
-
|
147
|
-
# This allows you to turn off ESI fuel alert notifications
|
148
|
-
# to use the Structure's generated fuel notifications exclusively.
|
149
|
-
STRUCTURES_NOTIFICATION_DISABLE_ESI_FUEL_ALERTS = clean_setting(
|
150
|
-
"STRUCTURES_NOTIFICATION_DISABLE_ESI_FUEL_ALERTS", False
|
151
|
-
)
|
152
|
-
|
153
|
-
# Feature flag to enable refueled notifications
|
154
|
-
STRUCTURES_FEATURE_REFUELED_NOTIFICATIONS = clean_setting(
|
155
|
-
"STRUCTURES_FEATURE_REFUELED_NOTIFICATIONS", True
|
156
|
-
)
|
157
|
-
|
158
|
-
|
159
|
-
STRUCTURES_ESI_DIRECTOR_ERROR_MAX_RETRIES = clean_setting(
|
160
|
-
"STRUCTURES_ESI_DIRECTOR_ERROR_MAX_RETRIES", 3
|
161
|
-
)
|
162
|
-
"""Max retries before a character is deleted when ESI claims the character
|
163
|
-
is not a director (Since this sometimes is reported wrongly by ESI).
|
164
|
-
"""
|
{aa_structures-2.8.0 → aa_structures-2.9.1}/structures/core/notification_embeds/billing_embeds.py
RENAMED
@@ -7,15 +7,19 @@ import dhooks_lite
|
|
7
7
|
|
8
8
|
from django.db import models
|
9
9
|
from django.utils.translation import gettext as _
|
10
|
-
from eveuniverse.models import EveType
|
11
10
|
|
12
11
|
from app_utils.datetime import ldap_time_2_datetime
|
12
|
+
from app_utils.helpers import humanize_number
|
13
13
|
|
14
14
|
from structures.constants import EveTypeId
|
15
|
-
from structures.helpers import
|
15
|
+
from structures.helpers import get_or_create_eve_entity, get_or_create_eve_type
|
16
16
|
from structures.models import Notification, Webhook
|
17
17
|
|
18
|
-
from .helpers import
|
18
|
+
from .helpers import (
|
19
|
+
gen_eve_entity_link,
|
20
|
+
gen_solar_system_text,
|
21
|
+
target_datetime_formatted,
|
22
|
+
)
|
19
23
|
from .main import NotificationBaseEmbed
|
20
24
|
|
21
25
|
|
@@ -37,9 +41,9 @@ class BillType(models.IntegerChoices):
|
|
37
41
|
class NotificationBillingBillOutOfMoneyMsg(NotificationBaseEmbed):
|
38
42
|
def __init__(self, notification: Notification) -> None:
|
39
43
|
super().__init__(notification)
|
40
|
-
bill_type_id = self.
|
44
|
+
bill_type_id = self._data["billTypeID"]
|
41
45
|
bill_type_str = BillType.to_enum(bill_type_id).label
|
42
|
-
due_date = ldap_time_2_datetime(self.
|
46
|
+
due_date = ldap_time_2_datetime(self._data["dueDate"])
|
43
47
|
self._title = _("Insufficient Funds for Bill")
|
44
48
|
self._description = _(
|
45
49
|
"The selected corporation wallet division for automatic payments "
|
@@ -58,7 +62,7 @@ class NotificationBillingIHubBillAboutToExpire(NotificationBaseEmbed):
|
|
58
62
|
def __init__(self, notification: Notification) -> None:
|
59
63
|
super().__init__(notification)
|
60
64
|
solar_system_link = gen_solar_system_text(self._notification.eve_solar_system())
|
61
|
-
due_date = ldap_time_2_datetime(self.
|
65
|
+
due_date = ldap_time_2_datetime(self._data.get("dueDate"))
|
62
66
|
self._title = _("IHub Bill About to Expire")
|
63
67
|
self._description = _(
|
64
68
|
"Maintenance bill for Infrastructure Hub in %(solar_system)s "
|
@@ -69,7 +73,7 @@ class NotificationBillingIHubBillAboutToExpire(NotificationBaseEmbed):
|
|
69
73
|
"due_date": target_datetime_formatted(due_date),
|
70
74
|
}
|
71
75
|
self._color = Webhook.Color.DANGER
|
72
|
-
structure_type =
|
76
|
+
structure_type = get_or_create_eve_type(id=EveTypeId.IHUB)
|
73
77
|
self._thumbnail = dhooks_lite.Thumbnail(
|
74
78
|
structure_type.icon_url(size=self.ICON_DEFAULT_SIZE)
|
75
79
|
)
|
@@ -92,3 +96,32 @@ class NotificationBillingIHubDestroyedByBillFailure(NotificationBaseEmbed):
|
|
92
96
|
self._thumbnail = dhooks_lite.Thumbnail(
|
93
97
|
structure_type.icon_url(size=self.ICON_DEFAULT_SIZE)
|
94
98
|
)
|
99
|
+
|
100
|
+
|
101
|
+
class NotificationCorpAllBillMsg(NotificationBaseEmbed):
|
102
|
+
def __init__(self, notification: Notification) -> None:
|
103
|
+
super().__init__(notification)
|
104
|
+
amount = self._data["amount"]
|
105
|
+
bill_type_id = self._data["billTypeID"]
|
106
|
+
bill_type_str = BillType.to_enum(bill_type_id).label
|
107
|
+
current_date = ldap_time_2_datetime(self._data["currentDate"])
|
108
|
+
due_date = ldap_time_2_datetime(self._data["dueDate"])
|
109
|
+
creditor = get_or_create_eve_entity(id=self._data["creditorID"])
|
110
|
+
debtor = get_or_create_eve_entity(id=self._data["debtorID"])
|
111
|
+
self._title = _("Bill issued")
|
112
|
+
self._description = _(
|
113
|
+
"A bill of %(amount)s ISK, due %(due_date)s owed by %(debtor)s "
|
114
|
+
"to %(creditor)s was issued %(current_date)s. "
|
115
|
+
"This bill is for %(bill_type)s."
|
116
|
+
) % {
|
117
|
+
"amount": humanize_number(amount),
|
118
|
+
"bill_type": bill_type_str,
|
119
|
+
"creditor": gen_eve_entity_link(creditor),
|
120
|
+
"debtor": gen_eve_entity_link(debtor),
|
121
|
+
"current_date": target_datetime_formatted(current_date),
|
122
|
+
"due_date": target_datetime_formatted(due_date),
|
123
|
+
}
|
124
|
+
self._color = Webhook.Color.WARNING
|
125
|
+
self._thumbnail = dhooks_lite.Thumbnail(
|
126
|
+
debtor.icon_url(size=self.ICON_DEFAULT_SIZE)
|
127
|
+
)
|
@@ -1,13 +1,12 @@
|
|
1
|
-
"""
|
1
|
+
"""Corporate embeds."""
|
2
2
|
|
3
3
|
# pylint: disable=missing-class-docstring
|
4
4
|
|
5
5
|
import dhooks_lite
|
6
6
|
|
7
7
|
from django.utils.translation import gettext as _
|
8
|
-
from eveuniverse.models import EveEntity
|
9
8
|
|
10
|
-
from structures.helpers import
|
9
|
+
from structures.helpers import get_or_create_eve_entity
|
11
10
|
from structures.models import Notification, Webhook
|
12
11
|
|
13
12
|
from .helpers import (
|
@@ -21,15 +20,11 @@ from .main import NotificationBaseEmbed
|
|
21
20
|
class NotificationCorpCharEmbed(NotificationBaseEmbed):
|
22
21
|
def __init__(self, notification: Notification) -> None:
|
23
22
|
super().__init__(notification)
|
24
|
-
self._character =
|
25
|
-
|
26
|
-
)
|
27
|
-
self._corporation = get_or_create_esi_obj(
|
28
|
-
EveEntity, id=self._parsed_text["corpID"]
|
29
|
-
)
|
23
|
+
self._character = get_or_create_eve_entity(id=self._data["charID"])
|
24
|
+
self._corporation = get_or_create_eve_entity(id=self._data["corpID"])
|
30
25
|
self._character_link = gen_eve_entity_link(self._character)
|
31
26
|
self._corporation_link = gen_corporation_link(self._corporation.name)
|
32
|
-
self._application_text = self.
|
27
|
+
self._application_text = self._data.get("applicationText", "")
|
33
28
|
self._thumbnail = dhooks_lite.Thumbnail(
|
34
29
|
self._character.icon_url(size=self.ICON_DEFAULT_SIZE)
|
35
30
|
)
|
@@ -60,7 +55,7 @@ class NotificationCorpAppInvitedMsg(NotificationCorpCharEmbed):
|
|
60
55
|
"character_name": self._character.name
|
61
56
|
}
|
62
57
|
inviting_character = gen_eve_entity_link_from_id(
|
63
|
-
self.
|
58
|
+
self._data.get("invokingCharID")
|
64
59
|
)
|
65
60
|
self._description = _(
|
66
61
|
"%(character_name)s has been invited to join %(corporation_name)s "
|
@@ -77,6 +72,22 @@ class NotificationCorpAppInvitedMsg(NotificationCorpCharEmbed):
|
|
77
72
|
self._color = Webhook.Color.INFO
|
78
73
|
|
79
74
|
|
75
|
+
class NotificationCharAppRejectMsg(NotificationCorpCharEmbed):
|
76
|
+
def __init__(self, notification: Notification) -> None:
|
77
|
+
super().__init__(notification)
|
78
|
+
self._title = _("%(character_name)s rejects invitation") % {
|
79
|
+
"character_name": self._character.name
|
80
|
+
}
|
81
|
+
self._description = _(
|
82
|
+
"Application from %(character_name)s to join %(corporation_name)s "
|
83
|
+
"has been rejected."
|
84
|
+
) % {
|
85
|
+
"character_name": self._character_link,
|
86
|
+
"corporation_name": self._corporation_link,
|
87
|
+
}
|
88
|
+
self._color = Webhook.Color.INFO
|
89
|
+
|
90
|
+
|
80
91
|
class NotificationCorpAppRejectCustomMsg(NotificationCorpCharEmbed):
|
81
92
|
def __init__(self, notification: Notification) -> None:
|
82
93
|
super().__init__(notification)
|
@@ -92,9 +103,8 @@ class NotificationCorpAppRejectCustomMsg(NotificationCorpCharEmbed):
|
|
92
103
|
"character_name": self._character_link,
|
93
104
|
"corporation_name": self._corporation_link,
|
94
105
|
"application_text": self._application_text,
|
95
|
-
"customMessage": self.
|
106
|
+
"customMessage": self._data.get("customMessage", ""),
|
96
107
|
}
|
97
|
-
|
98
108
|
self._color = Webhook.Color.INFO
|
99
109
|
|
100
110
|
|
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
# pylint: disable=missing-class-docstring
|
4
4
|
|
5
|
+
import re
|
5
6
|
from typing import Optional
|
6
7
|
|
7
8
|
import dhooks_lite
|
8
9
|
|
9
10
|
from django.conf import settings
|
10
11
|
from django.utils.translation import gettext as _
|
11
|
-
from eveuniverse.models import EveEntity
|
12
12
|
|
13
13
|
from app_utils.urls import reverse_absolute, static_file_absolute_url
|
14
14
|
|
15
15
|
from structures import __title__
|
16
16
|
from structures.core.notification_types import NotificationType
|
17
|
-
from structures.helpers import
|
17
|
+
from structures.helpers import get_or_create_eve_entity, is_absolute_url
|
18
18
|
from structures.models.notifications import Notification, NotificationBase, Webhook
|
19
19
|
|
20
20
|
from .helpers import target_datetime_formatted
|
@@ -33,7 +33,7 @@ class NotificationBaseEmbed:
|
|
33
33
|
if not isinstance(notification, NotificationBase):
|
34
34
|
raise TypeError("notification must be of type Notification")
|
35
35
|
self._notification = notification
|
36
|
-
self.
|
36
|
+
self._data = notification.parsed_text()
|
37
37
|
self._title = ""
|
38
38
|
self._description = ""
|
39
39
|
self._color = None
|
@@ -66,24 +66,24 @@ class NotificationBaseEmbed:
|
|
66
66
|
damage_parts = []
|
67
67
|
for prop in damage_labels:
|
68
68
|
field_name = f"{prop[0]}{field_postfix}"
|
69
|
-
if field_name in self.
|
69
|
+
if field_name in self._data:
|
70
70
|
label = prop[1]
|
71
|
-
value = self.
|
71
|
+
value = self._data[field_name] * factor
|
72
72
|
damage_parts.append(f"{label}: {value:.1f}%")
|
73
73
|
damage_text = " | ".join(damage_parts)
|
74
74
|
return damage_text
|
75
75
|
|
76
76
|
def get_aggressor_link(self) -> str:
|
77
77
|
"""Returns the aggressor link from a parsed_text for POS and POCOs only."""
|
78
|
-
if self.
|
78
|
+
if self._data.get("aggressorAllianceID"):
|
79
79
|
key = "aggressorAllianceID"
|
80
|
-
elif self.
|
80
|
+
elif self._data.get("aggressorCorpID"):
|
81
81
|
key = "aggressorCorpID"
|
82
|
-
elif self.
|
82
|
+
elif self._data.get("aggressorID"):
|
83
83
|
key = "aggressorID"
|
84
84
|
else:
|
85
85
|
return "(Unknown aggressor)"
|
86
|
-
entity =
|
86
|
+
entity = get_or_create_eve_entity(id=self._data[key])
|
87
87
|
return Webhook.create_link(entity.name, entity.profile_url)
|
88
88
|
|
89
89
|
def fuel_expires_target_date(self) -> str:
|
@@ -153,16 +153,18 @@ class NotificationBaseEmbed:
|
|
153
153
|
|
154
154
|
# pylint: disable = too-many-locals
|
155
155
|
@staticmethod
|
156
|
-
def create(
|
156
|
+
def create(notif: "NotificationBase") -> "NotificationBaseEmbed":
|
157
157
|
"""Creates a new instance of the respective subclass for given Notification."""
|
158
158
|
|
159
159
|
from .billing_embeds import (
|
160
160
|
NotificationBillingBillOutOfMoneyMsg,
|
161
161
|
NotificationBillingIHubBillAboutToExpire,
|
162
162
|
NotificationBillingIHubDestroyedByBillFailure,
|
163
|
+
NotificationCorpAllBillMsg,
|
163
164
|
)
|
164
|
-
from .
|
165
|
+
from .corporate_embeds import (
|
165
166
|
NotificationCharAppAcceptMsg,
|
167
|
+
NotificationCharAppRejectMsg,
|
166
168
|
NotificationCharAppWithdrawMsg,
|
167
169
|
NotificationCharLeftCorpMsg,
|
168
170
|
NotificationCorpAppInvitedMsg,
|
@@ -213,26 +215,42 @@ class NotificationBaseEmbed:
|
|
213
215
|
NotificationTowerResourceAlertMsg,
|
214
216
|
)
|
215
217
|
from .war_embeds import (
|
218
|
+
NotificationAcceptedAlly,
|
219
|
+
NotificationAllWarCorpJoinedAllianceMsg,
|
220
|
+
NotificationAllWarSurrenderMsg,
|
216
221
|
NotificationAllyJoinedWarMsg,
|
217
222
|
NotificationCorpWarSurrenderMsg,
|
223
|
+
NotificationDeclareWar,
|
224
|
+
NotificationMercOfferedNegotiationMsg,
|
225
|
+
NotificationMercOfferRetractedMsg,
|
226
|
+
NotificationOfferedSurrender,
|
227
|
+
NotificationOfferedToAlly,
|
218
228
|
NotificationWarAdopted,
|
219
229
|
NotificationWarCorporationBecameEligible,
|
220
230
|
NotificationWarCorporationNoLongerEligible,
|
221
231
|
NotificationWarDeclared,
|
232
|
+
NotificationWarHQRemovedFromSpace,
|
222
233
|
NotificationWarInherited,
|
234
|
+
NotificationWarInvalid,
|
223
235
|
NotificationWarRetractedByConcord,
|
224
236
|
NotificationWarSurrenderOfferMsg,
|
225
237
|
)
|
226
238
|
|
227
|
-
if not isinstance(
|
239
|
+
if not isinstance(notif, NotificationBase):
|
228
240
|
raise TypeError("notification must be of type NotificationBase")
|
229
241
|
|
230
242
|
NT = NotificationType
|
231
243
|
notif_type_2_class = {
|
244
|
+
# Billing
|
245
|
+
NT.BILLING_CORP_ALL_BILL_MSG: NotificationCorpAllBillMsg,
|
246
|
+
NT.BILLING_BILL_OUT_OF_MONEY_MSG: NotificationBillingBillOutOfMoneyMsg,
|
247
|
+
NT.BILLING_I_HUB_BILL_ABOUT_TO_EXPIRE: NotificationBillingIHubBillAboutToExpire,
|
248
|
+
NT.BILLING_I_HUB_DESTROYED_BY_BILL_FAILURE: NotificationBillingIHubDestroyedByBillFailure,
|
232
249
|
# character
|
233
250
|
NT.CORP_APP_NEW_MSG: NotificationCorpAppNewMsg,
|
234
251
|
NT.CORP_APP_INVITED_MSG: NotificationCorpAppInvitedMsg,
|
235
252
|
NT.CORP_APP_REJECT_CUSTOM_MSG: NotificationCorpAppRejectCustomMsg,
|
253
|
+
NT.CORP_APP_REJECT_MSG: NotificationCharAppRejectMsg,
|
236
254
|
NT.CHAR_APP_WITHDRAW_MSG: NotificationCharAppWithdrawMsg,
|
237
255
|
NT.CHAR_APP_ACCEPT_MSG: NotificationCharAppAcceptMsg,
|
238
256
|
NT.CHAR_LEFT_CORP_MSG: NotificationCharLeftCorpMsg,
|
@@ -242,7 +260,23 @@ class NotificationBaseEmbed:
|
|
242
260
|
NT.MOONMINING_AUTOMATIC_FRACTURE: NotificationMoonminningAutomaticFracture,
|
243
261
|
NT.MOONMINING_EXTRACTION_CANCELLED: NotificationMoonminningExtractionCanceled,
|
244
262
|
NT.MOONMINING_LASER_FIRED: NotificationMoonminningLaserFired,
|
245
|
-
#
|
263
|
+
# Orbitals
|
264
|
+
NT.ORBITAL_ATTACKED: NotificationOrbitalAttacked,
|
265
|
+
NT.ORBITAL_REINFORCED: NotificationOrbitalReinforced,
|
266
|
+
# Sov
|
267
|
+
NT.SOV_ENTOSIS_CAPTURE_STARTED: NotificationSovEntosisCaptureStarted,
|
268
|
+
NT.SOV_COMMAND_NODE_EVENT_STARTED: NotificationSovCommandNodeEventStarted,
|
269
|
+
NT.SOV_ALL_CLAIM_ACQUIRED_MSG: NotificationSovAllClaimAcquiredMsg,
|
270
|
+
NT.SOV_ALL_CLAIM_LOST_MSG: NotificationSovAllClaimLostMsg,
|
271
|
+
NT.SOV_STRUCTURE_REINFORCED: NotificationSovStructureReinforced,
|
272
|
+
NT.SOV_STRUCTURE_DESTROYED: NotificationSovStructureDestroyed,
|
273
|
+
NT.SOV_ALL_ANCHORING_MSG: NotificationSovAllAnchoringMsg,
|
274
|
+
# Towers
|
275
|
+
NT.TOWER_ALERT_MSG: NotificationTowerAlertMsg,
|
276
|
+
NT.TOWER_RESOURCE_ALERT_MSG: NotificationTowerResourceAlertMsg,
|
277
|
+
NT.TOWER_REFUELED_EXTRA: NotificationTowerRefueledExtra,
|
278
|
+
NT.TOWER_REINFORCED_EXTRA: NotificationTowerReinforcedExtra,
|
279
|
+
# Upwell structures
|
246
280
|
NT.STRUCTURE_ONLINE: NotificationStructureOnline,
|
247
281
|
NT.STRUCTURE_FUEL_ALERT: NotificationStructureFuelAlert,
|
248
282
|
NT.STRUCTURE_JUMP_FUEL_ALERT: NotificationStructureJumpFuelAlert,
|
@@ -258,42 +292,46 @@ class NotificationBaseEmbed:
|
|
258
292
|
NT.OWNERSHIP_TRANSFERRED: NotificationStructureOwnershipTransferred,
|
259
293
|
NT.STRUCTURE_ANCHORING: NotificationStructureAnchoring,
|
260
294
|
NT.STRUCTURE_REINFORCEMENT_CHANGED: NotificationStructureReinforceChange,
|
261
|
-
# Orbitals
|
262
|
-
NT.ORBITAL_ATTACKED: NotificationOrbitalAttacked,
|
263
|
-
NT.ORBITAL_REINFORCED: NotificationOrbitalReinforced,
|
264
|
-
# Towers
|
265
|
-
NT.TOWER_ALERT_MSG: NotificationTowerAlertMsg,
|
266
|
-
NT.TOWER_RESOURCE_ALERT_MSG: NotificationTowerResourceAlertMsg,
|
267
|
-
NT.TOWER_REFUELED_EXTRA: NotificationTowerRefueledExtra,
|
268
|
-
NT.TOWER_REINFORCED_EXTRA: NotificationTowerReinforcedExtra,
|
269
|
-
# Sov
|
270
|
-
NT.SOV_ENTOSIS_CAPTURE_STARTED: NotificationSovEntosisCaptureStarted,
|
271
|
-
NT.SOV_COMMAND_NODE_EVENT_STARTED: NotificationSovCommandNodeEventStarted,
|
272
|
-
NT.SOV_ALL_CLAIM_ACQUIRED_MSG: NotificationSovAllClaimAcquiredMsg,
|
273
|
-
NT.SOV_ALL_CLAIM_LOST_MSG: NotificationSovAllClaimLostMsg,
|
274
|
-
NT.SOV_STRUCTURE_REINFORCED: NotificationSovStructureReinforced,
|
275
|
-
NT.SOV_STRUCTURE_DESTROYED: NotificationSovStructureDestroyed,
|
276
|
-
NT.SOV_ALL_ANCHORING_MSG: NotificationSovAllAnchoringMsg,
|
277
295
|
# War
|
296
|
+
NT.WAR_ACCEPTED_ALLY: NotificationAcceptedAlly,
|
278
297
|
NT.WAR_ALLY_JOINED_WAR_AGGRESSOR_MSG: NotificationAllyJoinedWarMsg,
|
279
298
|
NT.WAR_ALLY_JOINED_WAR_ALLY_MSG: NotificationAllyJoinedWarMsg,
|
280
299
|
NT.WAR_ALLY_JOINED_WAR_DEFENDER_MSG: NotificationAllyJoinedWarMsg,
|
300
|
+
NT.WAR_ALL_WAR_CORP_JOINED_ALLIANCE_MSG: NotificationAllWarCorpJoinedAllianceMsg,
|
301
|
+
NT.WAR_ALL_WAR_SURRENDER_MSG: NotificationAllWarSurrenderMsg,
|
302
|
+
NT.WAR_CORPORATION_BECAME_ELIGIBLE: NotificationWarCorporationBecameEligible,
|
303
|
+
NT.WAR_CORPORATION_NO_LONGER_ELIGIBLE: NotificationWarCorporationNoLongerEligible,
|
304
|
+
NT.WAR_DECLARE_WAR: NotificationDeclareWar,
|
305
|
+
NT.WAR_MERC_OFFERED_NEGOTIATION_MSG: NotificationMercOfferedNegotiationMsg,
|
306
|
+
NT.WAR_MERC_OFFER_RETRACTED_MSG: NotificationMercOfferRetractedMsg,
|
281
307
|
NT.WAR_CORP_WAR_SURRENDER_MSG: NotificationCorpWarSurrenderMsg,
|
308
|
+
NT.WAR_HQ_REMOVED_FROM_SPACE: NotificationWarHQRemovedFromSpace,
|
309
|
+
NT.WAR_OFFERED_TO_ALLY: NotificationOfferedToAlly,
|
310
|
+
NT.WAR_OFFERED_SURRENDER: NotificationOfferedSurrender,
|
282
311
|
NT.WAR_WAR_ADOPTED: NotificationWarAdopted,
|
283
312
|
NT.WAR_WAR_DECLARED: NotificationWarDeclared,
|
284
313
|
NT.WAR_WAR_INHERITED: NotificationWarInherited,
|
314
|
+
NT.WAR_INVALID: NotificationWarInvalid,
|
285
315
|
NT.WAR_WAR_RETRACTED_BY_CONCORD: NotificationWarRetractedByConcord,
|
286
|
-
NT.WAR_CORPORATION_BECAME_ELIGIBLE: NotificationWarCorporationBecameEligible,
|
287
|
-
NT.WAR_CORPORATION_NO_LONGER_ELIGIBLE: NotificationWarCorporationNoLongerEligible,
|
288
316
|
NT.WAR_WAR_SURRENDER_OFFER_MSG: NotificationWarSurrenderOfferMsg,
|
289
|
-
# Billing
|
290
|
-
NT.BILLING_BILL_OUT_OF_MONEY_MSG: NotificationBillingBillOutOfMoneyMsg,
|
291
|
-
NT.BILLING_I_HUB_BILL_ABOUT_TO_EXPIRE: NotificationBillingIHubBillAboutToExpire,
|
292
|
-
NT.BILLING_I_HUB_DESTROYED_BY_BILL_FAILURE: NotificationBillingIHubDestroyedByBillFailure,
|
293
317
|
}
|
294
318
|
try:
|
295
|
-
notif_class = notif_type_2_class[
|
319
|
+
notif_class = notif_type_2_class[notif.notif_type]
|
296
320
|
except KeyError:
|
297
|
-
|
321
|
+
return NotificationGenericEmbed(notif)
|
322
|
+
|
323
|
+
return notif_class(notif)
|
324
|
+
|
298
325
|
|
299
|
-
|
326
|
+
class NotificationGenericEmbed(NotificationBaseEmbed):
|
327
|
+
"""A generic embed for undefined notifs."""
|
328
|
+
|
329
|
+
def __init__(self, notif: Notification) -> None:
|
330
|
+
super().__init__(notif)
|
331
|
+
self._title = re.sub(
|
332
|
+
r"((?<=[a-z])[A-Z]|(?<!\A)[A-Z](?=[a-z]))", r" \1", notif.notif_type
|
333
|
+
)
|
334
|
+
self._color = Webhook.Color.INFO
|
335
|
+
self._thumbnail = dhooks_lite.Thumbnail(
|
336
|
+
notif.sender.icon_url(size=self.ICON_DEFAULT_SIZE)
|
337
|
+
)
|