diff --git a/CHANGELOG.md b/CHANGELOG.md index 371b27e..82469cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -## [7.5.6](https://pypi.org/project/directory-forms-api-client/7.5.3/) (2026-02-16) -[Full Changelog](http://github.com/uktrade/directory-forms-api-client/pull/59) +## [7.5.7](https://pypi.org/project/directory-forms-api-client/7.5.3/) (2026-02-16) +[Full Changelog](http://github.com/uktrade/directory-forms-api-client/pull/60) - PLOPS-3455 - Added new get_forms_api_client function ## [7.5.3](https://pypi.org/project/directory-forms-api-client/7.5.3/) (2025-11-12) [Full Changelog](http://github.com/uktrade/directory-forms-api-client/pull/54) diff --git a/directory_forms_api_client/actions.py b/directory_forms_api_client/actions.py index 5175c7d..c6b5883 100644 --- a/directory_forms_api_client/actions.py +++ b/directory_forms_api_client/actions.py @@ -1,11 +1,11 @@ import abc -from directory_forms_api_client.client import forms_api_client +from directory_forms_api_client.client import get_forms_api_client class AbstractAction(abc.ABC): - def __init__(self, form_url, client=forms_api_client, form_session=None, sender=None, spam_control=None): + def __init__(self, form_url, client=get_forms_api_client(), form_session=None, sender=None, spam_control=None): self.form_url = form_url self.client = client self.form_session = form_session diff --git a/directory_forms_api_client/client.py b/directory_forms_api_client/client.py index b03853a..22d1f5c 100644 --- a/directory_forms_api_client/client.py +++ b/directory_forms_api_client/client.py @@ -64,7 +64,7 @@ def verification_reminders(self, data, authenticator=None): def _get_required_setting(name: str): # pragma: no cover if not hasattr(settings, name): - raise ImproperlyConfigured(f'Missing required setting for BG Profile client: {name}') + raise ImproperlyConfigured(f'Missing required setting for Forms API client: {name}') return getattr(settings, name) @@ -74,10 +74,10 @@ def get_forms_api_client() -> APIFormsClient: # pragma: no cover make testing easier. """ # Validate required settings explicitly - base_url = _get_required_setting('BG_PROFILE_BASE_URL') - api_key = _get_required_setting('BG_PROFILE_API_KEY') - sender_id = _get_required_setting('BG_PROFILE_SENDER_ID') - timeout = getattr(settings, 'BG_PROFILE_DEFAULT_TIMEOUT', 10) + base_url = _get_required_setting('DIRECTORY_FORMS_API_BASE_URL') + api_key = _get_required_setting('DIRECTORY_FORMS_API_API_KEY') + sender_id = _get_required_setting('DIRECTORY_FORMS_API_SENDER_ID') + timeout = getattr(settings, 'DIRECTORY_FORMS_API_DEFAULT_TIMEOUT', 10) return APIFormsClient( base_url=base_url, diff --git a/setup.py b/setup.py index a6efe49..9c519ac 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='directory_forms_api_client', - version='7.5.6', + version='7.5.7', url='https://github.com/uktrade/directory-forms-api-client', license='MIT', author='Department for Business and Trade',