From 546d416cd24563daf41a21a8cf0ecb7236822bd2 Mon Sep 17 00:00:00 2001 From: vasileios Date: Thu, 10 Sep 2026 16:41:00 +0200 Subject: [PATCH] [#6624] Updated EmailVerification model regarding the help texts When we first introduced the Email verification flow we did it only for the Email component. Now, the need is for Profile component too so we just updated the help text to be more cleat that the component key used can be of various component types. --- ...0_alter_emailverification_component_key.py | 29 +++++++++++++++++++ .../submissions/models/email_verification.py | 5 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/openforms/submissions/migrations/0020_alter_emailverification_component_key.py diff --git a/src/openforms/submissions/migrations/0020_alter_emailverification_component_key.py b/src/openforms/submissions/migrations/0020_alter_emailverification_component_key.py new file mode 100644 index 0000000000..3bf7db86f9 --- /dev/null +++ b/src/openforms/submissions/migrations/0020_alter_emailverification_component_key.py @@ -0,0 +1,29 @@ +# Generated by Django 5.2.17 on 2026-09-10 14:09 + +import re + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("submissions", "0019_alter_submissionfileattachment__data_path"), + ] + + operations = [ + migrations.AlterField( + model_name="emailverification", + name="component_key", + field=models.TextField( + help_text="Key of the component in the submission's form. The supported component types are Email and Profile.", + validators=[ + django.core.validators.RegexValidator( + message="Invalid variable key. It must only contain alphanumeric characters, underscores, dots and dashes and should not be ended by dash or dot.", + regex=re.compile("^(\\w|\\w[\\w.\\-]*\\w)$"), + ) + ], + verbose_name="component key", + ), + ), + ] diff --git a/src/openforms/submissions/models/email_verification.py b/src/openforms/submissions/models/email_verification.py index 9af8c093e9..9a42fcab60 100644 --- a/src/openforms/submissions/models/email_verification.py +++ b/src/openforms/submissions/models/email_verification.py @@ -51,7 +51,10 @@ class EmailVerification(models.Model): ) component_key = models.TextField( _("component key"), - help_text=_("Key of the email component in the submission's form."), + help_text=_( + "Key of the component in the submission's form. The supported component " + "types are Email and Profile." + ), validators=[variable_key_validator], ) email = models.EmailField(