aa-structures 2.4.0__tar.gz → 2.4.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.4.0 → aa_structures-2.4.1}/PKG-INFO +1 -1
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/__init__.py +1 -1
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/managers.py +34 -53
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_managers_1.py +29 -1
- {aa_structures-2.4.0 → aa_structures-2.4.1}/LICENSE +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/README.md +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/pyproject.toml +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/admin.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/app_settings.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/apps.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/auth_hooks.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/checks.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/constants.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/notification_embeds.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/notification_timers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/serializers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/sovereignty.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/core/starbases.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/forms.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/helpers/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/helpers/general.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/de/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/de/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/django.pot +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/en/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/en/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/es/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/es/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/fr_FR/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/it_IT/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ja/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ko/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ko/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ko_KR/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ru/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/ru/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/uk/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/locale/zh_Hans/LC_MESSAGES/django.po +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/management/commands/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/management/commands/structures_load_eve.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/management/commands/structures_preload_eveuniverse.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/migrations/0001_initial_new.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/migrations/0002_remove_eveuniverse_relation_names.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/migrations/0003_add_localization_and_unique_key.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/migrations/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/models/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/models/eveuniverse.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/models/notifications.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/models/owners.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/models/structures.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/providers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/css/global.css +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/css/main.css +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/Spinner-1s-64px-dark.gif +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/Spinner-1s-64px-light.gif +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/eve_symbol_128.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/0h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/0l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/0m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/0r.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/0s.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/1h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/1l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/1m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/1r.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/2h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/2l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/2m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/2r.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/3h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/3l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/3m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/3r.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/4h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/4l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/4m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/4s.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/5h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/5l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/5m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/5s.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/6h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/6l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/6m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/7h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/7l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/7m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/8h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/8l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/8m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/blank.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/circle.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/dustwheel.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/h.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/l.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/m.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/noship.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/r.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis_blue.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis_darkred.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis_default.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis_revelations.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/structures_logo.png +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tasks.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/base.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/main.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/fitting_assets.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/fitting_gfx.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/poco_details.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/starbase_detail.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/structure_details.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/tab_general_detail.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/partials/jump_gates_list.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/partials/poco_list.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/partials/structure_list.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/partials/structure_summary.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/templatetags/detail_title.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/templatetags/list_asset.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/templatetags/list_item.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/templatetags/list_tax_item.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/templatetags/list_title.html +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templatetags/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templatetags/structures.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_notification_embeds.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_notification_structuretimers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_notifications_timerboard.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_serializers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_sovereignty.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_starbases.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_eveuniverse.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_notifications_1.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_notifications_2.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_notifications_3.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_notifications_discord.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_owners_1.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_owners_2.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_owners_3.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_structures.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_admin.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_checks.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_helpers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_integration.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_managers_3.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_tasks.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/test_views.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/create_eveuniverse.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/entities.json +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/esi_data.json +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/eveuniverse.json +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/factories.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/factories_2.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_notifications.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_notifications_2.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_structures.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/helpers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/load_eveuniverse.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/tasks_loadtest.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/test_generate_structures.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/urls.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/views.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/core.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/managers.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/models.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/tests/__init__.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/tests/test_core.py +0 -0
- {aa_structures-2.4.0 → aa_structures-2.4.1}/structures/webhooks/tests/test_utils.py +0 -0
@@ -345,7 +345,7 @@ class StructureManagerBase(models.Manager):
|
|
345
345
|
obj, created = self.update_or_create_from_dict(structure=structure, owner=owner)
|
346
346
|
return obj, created
|
347
347
|
|
348
|
-
def update_or_create_from_dict(self, structure: dict, owner
|
348
|
+
def update_or_create_from_dict(self, structure: dict, owner) -> tuple:
|
349
349
|
"""update or create structure from given dict"""
|
350
350
|
|
351
351
|
from .models import StructureService
|
@@ -354,88 +354,69 @@ class StructureManagerBase(models.Manager):
|
|
354
354
|
eve_solar_system, _ = EveSolarSystem.objects.get_or_create_esi(
|
355
355
|
id=structure["system_id"]
|
356
356
|
)
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
next_reinforce_apply = (
|
366
|
-
structure["next_reinforce_apply"]
|
367
|
-
if "next_reinforce_apply" in structure
|
368
|
-
else None
|
369
|
-
)
|
370
|
-
reinforce_hour = (
|
371
|
-
structure["reinforce_hour"] if "reinforce_hour" in structure else None
|
372
|
-
)
|
373
|
-
state = (
|
374
|
-
self.model.State.from_esi_name(structure["state"])
|
375
|
-
if "state" in structure
|
376
|
-
else self.model.State.UNKNOWN
|
377
|
-
)
|
378
|
-
state_timer_start = (
|
379
|
-
structure["state_timer_start"] if "state_timer_start" in structure else None
|
380
|
-
)
|
381
|
-
state_timer_end = (
|
382
|
-
structure["state_timer_end"] if "state_timer_end" in structure else None
|
383
|
-
)
|
384
|
-
unanchors_at = (
|
385
|
-
structure["unanchors_at"] if "unanchors_at" in structure else None
|
386
|
-
)
|
387
|
-
position_x = structure["position"]["x"] if "position" in structure else None
|
388
|
-
position_y = structure["position"]["y"] if "position" in structure else None
|
389
|
-
position_z = structure["position"]["z"] if "position" in structure else None
|
390
|
-
if "planet_id" in structure:
|
391
|
-
eve_planet, _ = EvePlanet.objects.get_or_create_esi(
|
392
|
-
id=structure["planet_id"]
|
393
|
-
)
|
357
|
+
if position := structure.get("position"):
|
358
|
+
position_x = position.get("x")
|
359
|
+
position_y = position.get("y")
|
360
|
+
position_z = position.get("z")
|
361
|
+
else:
|
362
|
+
position_x = position_y = position_z = None
|
363
|
+
if planet_id := structure.get("planet_id"):
|
364
|
+
eve_planet, _ = EvePlanet.objects.get_or_create_esi(id=planet_id)
|
394
365
|
else:
|
395
366
|
eve_planet = None
|
396
|
-
if
|
397
|
-
eve_moon, _ = EveMoon.objects.get_or_create_esi(id=
|
367
|
+
if moon_id := structure.get("moon_id"):
|
368
|
+
eve_moon, _ = EveMoon.objects.get_or_create_esi(id=moon_id)
|
398
369
|
else:
|
399
370
|
eve_moon = None
|
371
|
+
|
372
|
+
structure_id = structure["structure_id"]
|
400
373
|
try:
|
401
|
-
old_obj = self.get(id=
|
374
|
+
old_obj = self.get(id=structure_id)
|
402
375
|
except self.model.DoesNotExist:
|
403
376
|
old_obj = None
|
377
|
+
|
404
378
|
obj, created = self.update_or_create(
|
405
|
-
id=
|
379
|
+
id=structure_id,
|
406
380
|
defaults={
|
407
381
|
"owner": owner,
|
408
382
|
"eve_type": eve_type,
|
409
|
-
"name": structure
|
383
|
+
"name": structure.get("name", ""),
|
410
384
|
"eve_solar_system": eve_solar_system,
|
411
385
|
"eve_planet": eve_planet,
|
412
386
|
"eve_moon": eve_moon,
|
413
387
|
"position_x": position_x,
|
414
388
|
"position_y": position_y,
|
415
389
|
"position_z": position_z,
|
416
|
-
"fuel_expires_at":
|
417
|
-
"next_reinforce_hour": next_reinforce_hour,
|
418
|
-
"next_reinforce_apply": next_reinforce_apply,
|
419
|
-
"reinforce_hour": reinforce_hour,
|
420
|
-
"state": state,
|
421
|
-
"state_timer_start": state_timer_start,
|
422
|
-
"state_timer_end": state_timer_end,
|
423
|
-
"unanchors_at": unanchors_at,
|
390
|
+
"fuel_expires_at": structure.get("fuel_expires"),
|
391
|
+
"next_reinforce_hour": structure.get("next_reinforce_hour"),
|
392
|
+
"next_reinforce_apply": structure.get("next_reinforce_apply"),
|
393
|
+
"reinforce_hour": structure.get("reinforce_hour"),
|
394
|
+
"state": self.model.State.from_esi_name(structure.get("state", "")),
|
395
|
+
"state_timer_start": structure.get("state_timer_start"),
|
396
|
+
"state_timer_end": structure.get("state_timer_end"),
|
397
|
+
"unanchors_at": structure.get("unanchors_at"),
|
424
398
|
"last_updated_at": now(),
|
425
399
|
},
|
426
400
|
)
|
401
|
+
|
427
402
|
if old_obj:
|
428
403
|
obj.handle_fuel_notifications(old_obj)
|
404
|
+
|
429
405
|
# Make sure we have dogmas loaded for this type for fittings
|
430
406
|
EveType.objects.get_or_create_esi(
|
431
407
|
id=structure["type_id"], enabled_sections=[EveType.Section.DOGMAS]
|
432
408
|
)
|
409
|
+
|
433
410
|
# save related structure services
|
434
411
|
StructureService.objects.filter(structure=obj).delete()
|
435
412
|
if "services" in structure and structure["services"]:
|
436
413
|
for service in structure["services"]:
|
437
|
-
|
438
|
-
args = {
|
414
|
+
service_state = StructureService.State.from_esi_name(service["state"])
|
415
|
+
args = {
|
416
|
+
"structure": obj,
|
417
|
+
"name": service["name"],
|
418
|
+
"state": service_state,
|
419
|
+
}
|
439
420
|
StructureService.objects.create(**args)
|
440
421
|
|
441
422
|
if obj.services.filter(state=StructureService.State.ONLINE).exists():
|
@@ -8,7 +8,7 @@ from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo
|
|
8
8
|
from app_utils.esi_testing import EsiClientStub, EsiEndpoint
|
9
9
|
from app_utils.testing import NoSocketsTestCase, create_user_from_evecharacter
|
10
10
|
|
11
|
-
from
|
11
|
+
from structures.models import (
|
12
12
|
EveSovereigntyMap,
|
13
13
|
NotificationType,
|
14
14
|
Owner,
|
@@ -17,11 +17,13 @@ from ..models import (
|
|
17
17
|
StructureTag,
|
18
18
|
Webhook,
|
19
19
|
)
|
20
|
+
|
20
21
|
from .testdata.factories import (
|
21
22
|
create_eve_sovereignty_map,
|
22
23
|
create_owner_from_user,
|
23
24
|
create_upwell_structure,
|
24
25
|
)
|
26
|
+
from .testdata.factories_2 import OwnerFactory
|
25
27
|
from .testdata.helpers import create_structures, load_entities
|
26
28
|
from .testdata.load_eveuniverse import load_eveuniverse
|
27
29
|
|
@@ -503,6 +505,32 @@ class TestStructureManagerCreateFromDict(NoSocketsTestCase):
|
|
503
505
|
self.assertFalse(created)
|
504
506
|
self.assertIsNone(structure.last_online_at)
|
505
507
|
|
508
|
+
def test_can_create_starbase_without_moon(self):
|
509
|
+
owner = OwnerFactory()
|
510
|
+
structure = {
|
511
|
+
"structure_id": 1300000000099,
|
512
|
+
"name": "Hidden place",
|
513
|
+
"system_id": 30002537,
|
514
|
+
"type_id": 16213,
|
515
|
+
"moon_id": None,
|
516
|
+
"position": {"x": 55028384780.0, "y": 7310316270.0, "z": -163686684205.0},
|
517
|
+
}
|
518
|
+
structure, created = Structure.objects.update_or_create_from_dict(
|
519
|
+
structure, owner
|
520
|
+
)
|
521
|
+
|
522
|
+
# check structure
|
523
|
+
structure: Structure
|
524
|
+
self.assertTrue(created)
|
525
|
+
self.assertEqual(structure.id, 1300000000099)
|
526
|
+
self.assertEqual(structure.eve_type_id, 16213)
|
527
|
+
self.assertEqual(structure.eve_solar_system_id, 30002537)
|
528
|
+
self.assertEqual(structure.owner, owner)
|
529
|
+
self.assertEqual(structure.position_x, 55028384780.0)
|
530
|
+
self.assertEqual(structure.position_y, 7310316270.0)
|
531
|
+
self.assertEqual(structure.position_z, -163686684205.0)
|
532
|
+
self.assertEqual(structure.state, Structure.State.UNKNOWN)
|
533
|
+
|
506
534
|
|
507
535
|
class TestStructureTagManager(NoSocketsTestCase):
|
508
536
|
@classmethod
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/management/commands/structures_load_eve.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/eve_symbol_128.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/blank.png
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/circle.png
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/dustwheel.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/noship.png
RENAMED
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis.png
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/panel/tyrannis_blue.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/static/structures/img/structures_logo.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/fitting_gfx.html
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/modals/poco_details.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/templates/structures/partials/poco_list.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_notification_embeds.py
RENAMED
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/core/test_notifications_timerboard.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/models/test_notifications_discord.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_notifications.py
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_notifications_2.py
RENAMED
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/generate_structures.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aa_structures-2.4.0 → aa_structures-2.4.1}/structures/tests/testdata/test_generate_structures.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|