aa-structures 3.0.2__py3-none-any.whl → 3.2.0__py3-none-any.whl
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-3.0.2.dist-info → aa_structures-3.2.0.dist-info}/METADATA +2 -2
- {aa_structures-3.0.2.dist-info → aa_structures-3.2.0.dist-info}/RECORD +9 -8
- structures/__init__.py +1 -1
- structures/apps.py +3 -0
- structures/checks.py +49 -0
- structures/tasks.py +3 -0
- structures/tests/test_tasks.py +2 -0
- {aa_structures-3.0.2.dist-info → aa_structures-3.2.0.dist-info}/WHEEL +0 -0
- {aa_structures-3.0.2.dist-info → aa_structures-3.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: aa-structures
|
3
|
-
Version: 3.0
|
3
|
+
Version: 3.2.0
|
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
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Topic :: Internet :: WWW/HTTP
|
21
21
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
22
22
|
License-File: LICENSE
|
23
|
-
Requires-Dist: allianceauth-app-utils>=1.
|
23
|
+
Requires-Dist: allianceauth-app-utils>=1.27
|
24
24
|
Requires-Dist: allianceauth>=4,<5
|
25
25
|
Requires-Dist: dhooks-lite>=1.0
|
26
26
|
Requires-Dist: django-eveuniverse>=1.5.2
|
@@ -1,14 +1,15 @@
|
|
1
|
-
structures/__init__.py,sha256=
|
1
|
+
structures/__init__.py,sha256=yRLr9DYNwHt6AoPk28of4869LzuVHw9SNw7nVii_sXE,203
|
2
2
|
structures/admin.py,sha256=K7wh8mHFfGHONn7oLdqXsBAxq0rmYrwbZ7S3uIOuMtg,41303
|
3
3
|
structures/app_settings.py,sha256=aWA2bTcv_vVwIyisx-G7GBSpfM6JDyt2MWcXKtHnjK0,6651
|
4
|
-
structures/apps.py,sha256=
|
4
|
+
structures/apps.py,sha256=lTn0cSCzbUr_6To6utVpApkPcBdwJBYHwYFNqeSamk8,298
|
5
5
|
structures/auth_hooks.py,sha256=nRbrixFkAE5gphDokB1E8xhH8FY2VtXVwu0XMmSGBAw,1013
|
6
|
+
structures/checks.py,sha256=FbuGC0-pHpv9YBvtZVUH1kwAsJYzdd3nQVqhm0mggbI,1397
|
6
7
|
structures/constants.py,sha256=k5rfD29ZjR7ToRmJw4WnLVd4LmoZvDw4OK5IoiiyJ6w,1063
|
7
8
|
structures/forms.py,sha256=kXs-SGIIj-D9xtFCILKe_PMRU4eHl3-HLNWRhaZKmnQ,391
|
8
9
|
structures/helpers.py,sha256=iadnXcpkHrWciB9snTHyc2bfxk3Hd5Xj1hKshOpvTJU,2542
|
9
10
|
structures/managers.py,sha256=_XZhsWb4is7LpQTUmGZwxQeJzyZnsB3n21EETgEIlzU,20062
|
10
11
|
structures/providers.py,sha256=9QYHd8X5HwBhrbgbX3LUrXXV1KGM3hFhcxK6qIJjJtg,317
|
11
|
-
structures/tasks.py,sha256=
|
12
|
+
structures/tasks.py,sha256=71f7Bhx84FjyTOWZvTjfDKAO3cOLRCAf16K50Z0Ke_g,9200
|
12
13
|
structures/urls.py,sha256=An5v27AD_NXMNL66cMVtQNci1C_Aqry32rrvDkMpgYo,1467
|
13
14
|
structures/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
15
|
structures/core/notification_timers.py,sha256=KLjkVrlCCKTWtHJNUfI3U6ppAIZN8vPnIx1zCafRkKQ,16748
|
@@ -168,7 +169,7 @@ structures/tests/test_admin.py,sha256=aDd88Ry0ahitpYyF_wa1jG_pWJ5m5w3jsat45sBhEm
|
|
168
169
|
structures/tests/test_helpers.py,sha256=BQC-4H-9-v5qW4nugqy0bkxuGlA3UO2clYY2lI2LjoY,4893
|
169
170
|
structures/tests/test_managers_1.py,sha256=4dnlK7Le04eJUPjJc9ex5BxZWIJGAyEvdKuuYXU2gqY,34846
|
170
171
|
structures/tests/test_managers_2.py,sha256=FISr_NT1Qnu9j1JYYTceNsUk8k9rfCTKwjKi5WUVbPs,3025
|
171
|
-
structures/tests/test_tasks.py,sha256=
|
172
|
+
structures/tests/test_tasks.py,sha256=21Z-nCVZi_MgfRSYYGQAoghIrDOEGMNuqwpF_krrH8o,17372
|
172
173
|
structures/tests/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
173
174
|
structures/tests/core/test_notification_structuretimers.py,sha256=OvldjgIHmRVsqoC9C6VJRqwS9WeRFMgpyutRc69PjAU,10857
|
174
175
|
structures/tests/core/test_notification_types.py,sha256=2J5A8Dr9UHhzLEj6QTMty5iZXlNkQxtFmLvU8Wpdno4,10447
|
@@ -228,7 +229,7 @@ structures/webhooks/models.py,sha256=kUkt9rnRQIJIrU9Bjcs34rvkb-TMbUubHdn-kny08kI
|
|
228
229
|
structures/webhooks/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
229
230
|
structures/webhooks/tests/test_core.py,sha256=4NcEAQgK2KhQkFOxYh2ad0S-qUWh1DNGDmLo5Mo5opI,6762
|
230
231
|
structures/webhooks/tests/test_utils.py,sha256=ekADFv0JOEtXeqdiejbeqrABO__Q1flJHzVieQ7L9e0,459
|
231
|
-
aa_structures-3.0.
|
232
|
-
aa_structures-3.0.
|
233
|
-
aa_structures-3.0.
|
234
|
-
aa_structures-3.0.
|
232
|
+
aa_structures-3.2.0.dist-info/licenses/LICENSE,sha256=XZiwB_S_40_HhnvLg5xvtBb3g1oGjPrk0rpFwk8iInE,1070
|
233
|
+
aa_structures-3.2.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
234
|
+
aa_structures-3.2.0.dist-info/METADATA,sha256=HuRNqoF8ZykrYhNp4AyflxLgi8EeIdIbQE74_RA3dVQ,6006
|
235
|
+
aa_structures-3.2.0.dist-info/RECORD,,
|
structures/__init__.py
CHANGED
structures/apps.py
CHANGED
structures/checks.py
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
"""Django checks."""
|
2
|
+
|
3
|
+
import numbers
|
4
|
+
|
5
|
+
from django.conf import settings
|
6
|
+
from django.core.checks import Warning, register
|
7
|
+
|
8
|
+
|
9
|
+
@register()
|
10
|
+
def structures_config_check(app_configs, **kwargs): # pylint: disable=W0613
|
11
|
+
"""structures_config_check is a Django check that verifies that all periodic tasks
|
12
|
+
have been configured correctly in settings.
|
13
|
+
"""
|
14
|
+
if not hasattr(settings, "CELERYBEAT_SCHEDULE"):
|
15
|
+
return []
|
16
|
+
|
17
|
+
warnings = []
|
18
|
+
for name, obj in settings.CELERYBEAT_SCHEDULE.items():
|
19
|
+
_verify_task_config(
|
20
|
+
warnings, name, obj, "structures.tasks.update_all_structures"
|
21
|
+
)
|
22
|
+
_verify_task_config(
|
23
|
+
warnings, name, obj, "structures.tasks.fetch_all_notifications"
|
24
|
+
)
|
25
|
+
return warnings
|
26
|
+
|
27
|
+
|
28
|
+
def _verify_task_config(warnings: list, name: str, obj: dict, task_name: str):
|
29
|
+
if obj["task"] != task_name:
|
30
|
+
return
|
31
|
+
|
32
|
+
schedule = obj["schedule"]
|
33
|
+
if isinstance(schedule, numbers.Number):
|
34
|
+
return
|
35
|
+
|
36
|
+
warnings.append(
|
37
|
+
Warning(
|
38
|
+
(
|
39
|
+
"Periodic task has deprecated schedule: "
|
40
|
+
f'CELERYBEAT_SCHEDULE["{name}"]'
|
41
|
+
),
|
42
|
+
hint=(
|
43
|
+
'The value for "schedule" must be a positive number, '
|
44
|
+
"not e.g. a cron definition. "
|
45
|
+
f"Current value is: {schedule}"
|
46
|
+
),
|
47
|
+
id="structures.W001",
|
48
|
+
)
|
49
|
+
)
|
structures/tasks.py
CHANGED
@@ -44,6 +44,9 @@ def update_all_structures():
|
|
44
44
|
@shared_task(time_limit=STRUCTURES_TASKS_TIME_LIMIT)
|
45
45
|
def update_sov_map():
|
46
46
|
"""Update sovereignty map from ESI."""
|
47
|
+
if not fetch_esi_status().is_ok:
|
48
|
+
logger.warning("ESI currently not available. Aborting.")
|
49
|
+
return
|
47
50
|
EveSovereigntyMap.objects.update_or_create_all_from_esi()
|
48
51
|
|
49
52
|
|
structures/tests/test_tasks.py
CHANGED
@@ -3,6 +3,7 @@ from unittest.mock import patch
|
|
3
3
|
from django.contrib.auth.models import User
|
4
4
|
from django.test import TestCase, override_settings
|
5
5
|
|
6
|
+
from app_utils.esi import EsiStatus
|
6
7
|
from app_utils.testdata_factories import UserFactory
|
7
8
|
from app_utils.testing import NoSocketsTestCase, generate_invalid_pk
|
8
9
|
|
@@ -316,6 +317,7 @@ class TestUpdateNotificationsStructureRelations(NoSocketsTestCase):
|
|
316
317
|
self.assertEqual(result, 0)
|
317
318
|
|
318
319
|
|
320
|
+
@patch(MODULE_PATH + ".fetch_esi_status", lambda: EsiStatus(True))
|
319
321
|
class TestOtherTasks(NoSocketsTestCase):
|
320
322
|
@patch(
|
321
323
|
MODULE_PATH + ".EveSovereigntyMap.objects.update_or_create_all_from_esi",
|
File without changes
|
File without changes
|