-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2966] Refactor configuration for registering contactmomenten
- move relevant fields from ESuiteKlantConfig to global KlantenSysteemConfig so they can be used for OpenKlant2 as well
- Loading branch information
Paul Schilling
committed
Jan 14, 2025
1 parent
65b1058
commit c6d86d2
Showing
9 changed files
with
266 additions
and
53 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
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
41 changes: 41 additions & 0 deletions
41
...inwoner/openklant/migrations/0019_klantensysteemconfig_register_contact_email_and_more.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,41 @@ | ||
# Generated by Django 4.2.16 on 2025-01-14 13:17 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("openklant", "0018_rename_openklantconfig_esuiteklantconfig_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="klantensysteemconfig", | ||
name="register_contact_email", | ||
field=models.EmailField( | ||
blank=True, | ||
help_text="Contacts initiated or questions submitted by a client (e.g. via a contact form) will be registered via email.", | ||
max_length=254, | ||
verbose_name="Registreer vragen/contactmomenten op email adres", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="klantensysteemconfig", | ||
name="register_contact_via_api", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="Contacts initiated or questions submitted by a client (e.g. via a contact form) will be registered in the appropriate API (eSuite or OpenKlant2).", | ||
verbose_name="Registreer vragen/contactmomenten op API", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="klantensysteemconfig", | ||
name="send_email_confirmation", | ||
field=models.BooleanField( | ||
help_text="If enabled the 'contactform_confirmation' email template will be sent. If disabled the external API will send a confirmation email.", | ||
verbose_name="Stuur contactformulier e-mailbevestiging", | ||
default=False, | ||
), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
src/open_inwoner/openklant/migrations/0020_alter_klantensysteemconfig_primary_backend.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,25 @@ | ||
# Generated by Django 4.2.16 on 2025-01-14 13:18 | ||
|
||
from django.db import migrations, models | ||
|
||
import open_inwoner.openklant.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("openklant", "0019_klantensysteemconfig_register_contact_email_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="klantensysteemconfig", | ||
name="primary_backend", | ||
field=models.CharField( | ||
choices=[("ESUITE", "esuite"), ("OPENKLANT2", "openklant2")], | ||
help_text="Choose the primary backend for retrieving klanten data. Changes to klanten data will be saved to both backends (if configured).", | ||
max_length=10, | ||
validators=[open_inwoner.openklant.models.validate_primary_backend], | ||
), | ||
), | ||
] |
31 changes: 31 additions & 0 deletions
31
src/open_inwoner/openklant/migrations/0021_contactmoment_register_config.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,31 @@ | ||
# Generated by Django 4.2.16 on 2025-01-14 13:42 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def migrate_registration_defaults(apps, _): | ||
ESuiteKlantConfig = apps.get_model("openklant", "ESuiteKlantConfig") | ||
KlantenSysteemConfig = apps.get_model("openklant", "KlantenSysteemConfig") | ||
|
||
es_config = ESuiteKlantConfig.objects.first() | ||
klanten_config = KlantenSysteemConfig.objects.first() | ||
|
||
if es_config and klanten_config: | ||
klanten_config.register_contact_via_api = es_config.register_contact_moment | ||
klanten_config.register_contact_email = es_config.register_email | ||
klanten_config.send_email_confirmation = es_config.send_email_confirmation | ||
klanten_config.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("openklant", "0020_alter_klantensysteemconfig_primary_backend"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
code=migrate_registration_defaults, | ||
reverse_code=migrations.RunPython.noop, | ||
) | ||
] |
44 changes: 44 additions & 0 deletions
44
...er/openklant/migrations/0022_remove_esuiteklantconfig_register_contact_moment_and_more.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,44 @@ | ||
# Generated by Django 4.2.16 on 2025-01-14 13:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("openklant", "0021_contactmoment_register_config"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="esuiteklantconfig", | ||
name="register_contact_moment", | ||
), | ||
migrations.RemoveField( | ||
model_name="esuiteklantconfig", | ||
name="register_email", | ||
), | ||
migrations.RemoveField( | ||
model_name="esuiteklantconfig", | ||
name="send_email_confirmation", | ||
), | ||
migrations.AlterField( | ||
model_name="klantensysteemconfig", | ||
name="register_contact_email", | ||
field=models.EmailField( | ||
blank=True, | ||
help_text="Contacts initiated or questions submitted by a client (e.g. via a contact form) will be registered via email.", | ||
max_length=254, | ||
verbose_name="Registreer op email adres", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="klantensysteemconfig", | ||
name="register_contact_via_api", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="Contacts initiated or questions submitted by a client (e.g. via a contact form) will be registered in the appropriate API (eSuite or OpenKlant2).", | ||
verbose_name="Registreer op API", | ||
), | ||
), | ||
] |
Oops, something went wrong.