-
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.
Merge pull request #4472 from open-formulieren/feature/4246-adapt-pre…
…fill-to-auth-context Adapt prefill to new auth context
- Loading branch information
Showing
17 changed files
with
362 additions
and
47 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
src/openforms/forms/migrations/0102_alter_formvariable_prefill_identifier_role.py
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,24 @@ | ||
# Generated by Django 4.2.11 on 2024-07-02 06:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("forms", "0101_objecttype_url_to_uuid"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="formvariable", | ||
name="prefill_identifier_role", | ||
field=models.CharField( | ||
choices=[("main", "Main"), ("authorised_person", "Authorizee")], | ||
default="main", | ||
help_text="In case that multiple identifiers are returned (in the case of eHerkenning bewindvoering and DigiD Machtigen), should the prefill data related to the main identifier be used, or that related to the authorised person?", | ||
max_length=100, | ||
verbose_name="prefill identifier role", | ||
), | ||
), | ||
] |
46 changes: 46 additions & 0 deletions
46
src/openforms/forms/migrations/0103_rename_identifier_role_prefill.py
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,46 @@ | ||
# Generated by Django 4.2.11 on 2024-07-02 09:03 | ||
|
||
from django.db import migrations, models | ||
from django.db.migrations.state import StateApps | ||
|
||
from openforms.forms.migration_operations import ConvertComponentsOperation | ||
|
||
|
||
def rename_authorizee_enum(apps: StateApps, _): | ||
FormVariable = apps.get_model("forms", "FormVariable") | ||
FormVariable.objects.filter(prefill_identifier_role="authorised_person").update( | ||
prefill_identifier_role="authorizee" | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("forms", "0102_alter_formvariable_prefill_identifier_role"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
rename_authorizee_enum, | ||
# no point in adding a reverse operation when ConvertComponent doesn't | ||
# support it - if it's wrong, we recommend restoring a backup. | ||
migrations.RunPython.noop, | ||
), | ||
# only lists the components that have prefill | ||
ConvertComponentsOperation("textfield", "rename_identifier_role_authorizee"), | ||
ConvertComponentsOperation("date", "rename_identifier_role_authorizee"), | ||
ConvertComponentsOperation("datetime", "rename_identifier_role_authorizee"), | ||
ConvertComponentsOperation("postcode", "rename_identifier_role_authorizee"), | ||
ConvertComponentsOperation("bsn", "rename_identifier_role_authorizee"), | ||
migrations.AlterField( | ||
model_name="formvariable", | ||
name="prefill_identifier_role", | ||
field=models.CharField( | ||
choices=[("main", "Main"), ("authorizee", "Authorizee")], | ||
default="main", | ||
help_text="In case that multiple identifiers are returned (in the case of eHerkenning bewindvoering and DigiD Machtigen), should the prefill data related to the main identifier be used, or that related to the authorised person?", | ||
max_length=100, | ||
verbose_name="prefill identifier role", | ||
), | ||
), | ||
] |
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
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
Oops, something went wrong.