Compare commits

..

1 Commits

Author SHA1 Message Date
Peter Pfeufer
f35a5ea725 Merge branch 'django-esi-min-version' into 'master'
[CHANGE] Django ESI min version

See merge request allianceauth/allianceauth!1734
2025-07-05 08:10:38 +00:00
3 changed files with 5 additions and 18 deletions

View File

@ -7,6 +7,5 @@ manage online service access.
__version__ = '4.8.0'
__title__ = 'Alliance Auth'
__title_useragent__ = 'AllianceAuth'
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
NAME = f'{__title__} v{__version__}'

View File

@ -7,7 +7,7 @@ from jsonschema.exceptions import RefResolutionError
from django.conf import settings
from esi.clients import esi_client_factory
from allianceauth import __version__, __title_useragent__, __url__
from allianceauth import __version__
from allianceauth.utils.django import StartupCommand
@ -185,9 +185,7 @@ class EveSwaggerProvider(EveProvider):
self._client = esi_client_factory(
token=token,
spec_file=SWAGGER_SPEC_PATH,
ua_appname=__title_useragent__,
ua_version=__version__,
ua_url=__url__
app_info_text=f"allianceauth v{__version__}"
)
except (HTTPError, RefResolutionError):
logger.exception(
@ -204,11 +202,7 @@ class EveSwaggerProvider(EveProvider):
def client(self):
if self._client is None:
self._client = esi_client_factory(
token=self._token,
spec_file=SWAGGER_SPEC_PATH,
ua_appname=__title_useragent__,
ua_version=__version__,
ua_url=__url__
token=self._token, spec_file=SWAGGER_SPEC_PATH, app_info_text=("allianceauth v" + __version__)
)
return self._client

View File

@ -6,12 +6,6 @@ from jsonschema.exceptions import RefResolutionError
from django.test import TestCase
from allianceauth import __url__ as aa_url
from allianceauth import __version__ as aa_version
from esi import __url__ as esi_url
from esi import __version__ as esi_version
from . import set_logger
from .esi_client_stub import EsiClientStub
from ..providers import (
@ -723,11 +717,11 @@ class TestEveSwaggerProvider(TestCase):
self.assertIsNotNone(my_provider._client)
self.assertEqual(my_client, 'my_client')
@patch(MODULE_PATH + '.__version__', '1.0.0')
def test_user_agent_header(self):
my_provider = EveSwaggerProvider()
my_client = my_provider.client
operation = my_client.Universe.get_universe_factions()
self.assertEqual(
operation.future.request.headers['User-Agent'],
f'AllianceAuth/{aa_version} (dummy@example.net; +{aa_url}) Django-ESI/{esi_version} (+{esi_url})'
operation.future.request.headers['User-Agent'], 'allianceauth v1.0.0 dummy@example.net'
)