-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
50 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from openforms.forms.models.form import Form | ||
from openforms.plugins.exceptions import InvalidPluginConfiguration | ||
|
||
from .checks import BRKValidatorCheck | ||
|
||
|
||
def check_brk_config_for_addressNL() -> str: | ||
live_forms = Form.objects.live() | ||
|
||
if any(form.has_component("addressNL") for form in live_forms): | ||
try: | ||
BRKValidatorCheck.check_config() | ||
except InvalidPluginConfiguration as e: | ||
return e.args[0] | ||
|
||
return "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,12 +361,12 @@ def test_broken_brk_configuration_for_addressNL_is_sent(self): | |
self.assertEqual(sent_email.recipients(), ["[email protected]"]) | ||
self.assertIn( | ||
_( | ||
"Configuration for 'BRK Client' is broken (KVK endpoint is not configured)." | ||
"The configuration for 'BRK Client' is invalid (KVK endpoint is not configured)." | ||
), | ||
sent_email.body, | ||
) | ||
|
||
def test_no_email_sent_when_brk_congiguration_is_valid_for_other_component(self): | ||
def test_no_email_sent_when_brk_congiguration_is_invalid_but_unused(self): | ||
form = FormFactory.create() | ||
form_definition = FormDefinitionFactory.create( | ||
configuration={ | ||
|
@@ -390,6 +390,10 @@ def test_no_email_sent_when_brk_congiguration_is_valid_for_other_component(self) | |
recipients_email_digest=["[email protected]"] | ||
), | ||
), | ||
patch( | ||
"openforms.contrib.brk.client.BRKConfig.get_solo", | ||
return_value=BRKConfig(service=None), | ||
), | ||
): | ||
|
||
send_email_digest() | ||
|