diff --git a/src/openforms/authentication/templates/of_authentication/registrator_subject_info.html b/src/openforms/authentication/templates/of_authentication/registrator_subject_info.html index 3af0336a57..38a7865c0b 100644 --- a/src/openforms/authentication/templates/of_authentication/registrator_subject_info.html +++ b/src/openforms/authentication/templates/of_authentication/registrator_subject_info.html @@ -1,13 +1,6 @@ {% extends 'ui/views/abstract/detail.html' %} {% load i18n static %} -{% block extra_css %} - {{ block.super }} - - {# Needed for the styling of the auth-mode class #} - -{% endblock %} - {% block card %}
diff --git a/src/openforms/registrations/contrib/email/plugin.py b/src/openforms/registrations/contrib/email/plugin.py index eee1d091b4..d749b76ee6 100644 --- a/src/openforms/registrations/contrib/email/plugin.py +++ b/src/openforms/registrations/contrib/email/plugin.py @@ -45,6 +45,14 @@ class EmailRegistration(BasePlugin[Options]): verbose_name = _("Email registration") configuration_options = EmailOptionsSerializer + def verify_initial_data_ownership( + self, submission: Submission, options: Options + ) -> None: + """ + Ownership checks for email registration are not meaningful, allow anything. + """ + pass + @staticmethod def get_recipients(submission: Submission, options: Options) -> list[str]: state = submission.load_submission_value_variables_state() diff --git a/src/openforms/registrations/contrib/email/tests/test_backend.py b/src/openforms/registrations/contrib/email/tests/test_backend.py index 47460b0de4..950becf12a 100644 --- a/src/openforms/registrations/contrib/email/tests/test_backend.py +++ b/src/openforms/registrations/contrib/email/tests/test_backend.py @@ -22,6 +22,7 @@ from openforms.payments.constants import PaymentStatus from openforms.payments.tests.factories import SubmissionPaymentFactory from openforms.submissions.attachments import attach_uploads_to_submission_step +from openforms.submissions.constants import PostSubmissionEvents from openforms.submissions.exports import create_submission_export from openforms.submissions.models import Submission from openforms.submissions.tests.factories import ( @@ -34,7 +35,8 @@ from openforms.utils.tests.html_assert import HTMLAssertMixin from openforms.variables.constants import FormVariableSources -from ..constants import AttachmentFormat +from ....tasks import pre_registration +from ..constants import PLUGIN_ID, AttachmentFormat from ..models import EmailConfig from ..plugin import EmailRegistration, Options @@ -1281,3 +1283,31 @@ def test_with_deferred_registration(self): # Verify that email was sent emails = mail.outbox self.assertEqual(len(emails), 2) + + @tag("gh-4650") + def test_register_submission_with_initial_data_reference(self): + """ + Test that submissions with initial data references can be registered. + + For email, no access control checks can be performed and there is no 'update + existing object' mechanic, so any submission with some initial data reference + (for prefill, for example) needs to be accepted. + """ + email_form_options: Options = { + "to_emails": ["recipient@example.com"], + "attach_files_to_email": None, + } + submission = SubmissionFactory.from_data( + {"whatever": "156/Silence"}, + completed_not_preregistered=True, + initial_data_reference="some-reference", + form__registration_backend=PLUGIN_ID, + form__registration_backend_options=email_form_options, + ) + + pre_registration(submission.pk, event=PostSubmissionEvents.on_completion) + + submission.refresh_from_db() + self.assertFalse(submission.needs_on_completion_retry) + self.assertTrue(submission.pre_registration_completed) + self.assertNotEqual(submission.public_registration_reference, "") diff --git a/src/openforms/templates/includes/forms/radio.html b/src/openforms/templates/includes/forms/radio.html index d965bb996c..1f79e59288 100644 --- a/src/openforms/templates/includes/forms/radio.html +++ b/src/openforms/templates/includes/forms/radio.html @@ -8,7 +8,7 @@ utrecht-form-fieldset__legend utrecht-form-fieldset__legend--html-legend utrecht-form-field__label"> -