-
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.
Move eherkenning eenmanszaak flag to more natural SiteConfiguration
- Loading branch information
1 parent
6455e92
commit 7895f32
Showing
6 changed files
with
76 additions
and
12 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
47 changes: 47 additions & 0 deletions
47
...er/configurations/migrations/0075_siteconfiguration_enable_eherkenning_for_eenmanszaak.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,47 @@ | ||
# Generated by Django 4.2.18 on 2025-02-04 09:07 | ||
|
||
import logging | ||
|
||
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist | ||
from django.db import migrations, models | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def copy_setting_from_openzaak_config(apps, _): | ||
OpenZaakConfig = apps.get_model("openzaak", "OpenZaakConfig") | ||
SiteConfiguration = apps.get_model("configurations", "SiteConfiguration") | ||
|
||
try: | ||
openzaak_config = OpenZaakConfig.objects.get() # should be a singleton | ||
site_config = SiteConfiguration.objects.get() | ||
except (ObjectDoesNotExist, MultipleObjectsReturned) as exc: | ||
logger.warning( | ||
"Unable to migrate `enable_eherkenning_for_eenmanszaak` flag from OpenZaakConfig, got error: {exc}", | ||
exc_info=True, | ||
) | ||
else: | ||
site_config.enable_eherkenning_for_eenmanszaak = ( | ||
openzaak_config.enable_eherkenning_for_eenmanszaak | ||
) | ||
site_config.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("configurations", "0074_alter_siteconfiguration_accent_color_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="siteconfiguration", | ||
name="enable_eherkenning_for_eenmanszaak", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="If enabled, eenmanszaken may authenticate using eHerkenning and subsequently their kvk nummer will be used to interface with the zaken and klanten backends). If not, an eenmanszaak will be forced to use DigiD, and the user's BSN will be used instead.", | ||
verbose_name="Allow eenmanszaken to authenticate using eHerkenning", | ||
), | ||
), | ||
migrations.RunPython(copy_setting_from_openzaak_config), | ||
] |
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
18 changes: 18 additions & 0 deletions
18
...oner/openzaak/migrations/0064_remove_openzaakconfig_enable_eherkenning_for_eenmanszaak.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,18 @@ | ||
# Generated by Django 4.2.18 on 2025-02-04 09:07 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("openzaak", "0063_alter_openzaakconfig_show_cases_without_status"), | ||
("configurations", "0075_siteconfiguration_enable_eherkenning_for_eenmanszaak"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="openzaakconfig", | ||
name="enable_eherkenning_for_eenmanszaak", | ||
), | ||
] |
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