Skip to content

Commit

Permalink
🔥 [#4908] Remove config checks from JSON registration plugin
Browse files Browse the repository at this point in the history
PR feedback: global config checks are not really useful for this plugin right now.
  • Loading branch information
viktorvanwijk committed Jan 2, 2025
1 parent 9840e1e commit b8a4cd8
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 251 deletions.
10 changes: 0 additions & 10 deletions src/openforms/registrations/contrib/json/admin.py

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions src/openforms/registrations/contrib/json/models.py

This file was deleted.

29 changes: 2 additions & 27 deletions src/openforms/registrations/contrib/json/plugin.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import base64

from django.urls import reverse
from django.utils.translation import gettext_lazy as _

from requests import RequestException
from zgw_consumers.client import build_client

from openforms.plugins.exceptions import InvalidPluginConfiguration
from openforms.submissions.models import Submission
from openforms.variables.service import get_static_variables

from ...base import BasePlugin # openforms.registrations.base
from ...registry import register # openforms.registrations.registry
from .config import JSONOptions, JSONOptionsSerializer
from .models import JSONConfig


@register("json")
Expand Down Expand Up @@ -78,26 +74,5 @@ def register_submission(self, submission: Submission, options: JSONOptions) -> d
return result

def check_config(self) -> None:
# Get service
config = JSONConfig.get_solo()
if (service := config.service) is None:
raise InvalidPluginConfiguration(_("Please configure a service"))

# Check connection to service
with build_client(service) as client:
try:
res = client.get(service.api_connection_check_path)
res.raise_for_status()
except RequestException as exc:
raise InvalidPluginConfiguration(_(f"Invalid response: {exc}")) from exc

def get_config_actions(self) -> list[tuple[str, str]]:
return [
(
_("Configuration"),
reverse(
"admin:registrations_json_jsonconfig_change",
args=(JSONConfig.singleton_instance_id,),
),
)
]
# Config checks are not really relevant for this plugin right now
pass

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b8a4cd8

Please sign in to comment.