-
Notifications
You must be signed in to change notification settings - Fork 27
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 #5128 from open-formulieren/release/3.0.5
Patch release 3.0.5
- Loading branch information
Showing
12 changed files
with
969 additions
and
782 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.0 | ||
3.0.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Fix the validation set on soft-required components. | ||
# | ||
# Due to a bug in the global configuration, the validation for soft-required components | ||
# could be set to `required: true`. This causes the form to be in-completable, as the | ||
# user cannot provide a value for the soft-required component. | ||
# The problem in the global configuration has been fixed, so new soft-required component | ||
# won't have this issue. | ||
# | ||
# This script automatically fixes the validation rules of all soft-required components. | ||
# Related to ticket: https://github.com/open-formulieren/open-forms/issues/5090 | ||
from __future__ import annotations | ||
|
||
import sys | ||
from pathlib import Path | ||
|
||
import django | ||
|
||
SRC_DIR = Path(__file__).parent.parent / "src" | ||
sys.path.insert(0, str(SRC_DIR.resolve())) | ||
|
||
|
||
def fix_softrequired_required_validation() -> None: | ||
from django.db.models import Q | ||
|
||
from openforms.forms.models import FormDefinition | ||
|
||
form_definitions_to_update = [] | ||
fds = FormDefinition.objects.iterator() | ||
for form_definition in fds: | ||
# Flag to update Form Definition. Is set when child component is changed | ||
should_persist_fd = False | ||
|
||
for component in form_definition.iter_components(): | ||
# The fix is only needed for softRequiredErrors components | ||
if component["type"] != "softRequiredErrors": | ||
continue | ||
|
||
# Only fix components with the required validation set to True | ||
if not component["validate"].get("required", False): | ||
continue | ||
|
||
component["validate"]["required"] = False | ||
# Set flag to update Form Definition | ||
should_persist_fd = True | ||
|
||
if should_persist_fd: | ||
form_definitions_to_update.append(form_definition) | ||
|
||
FormDefinition.objects.bulk_update( | ||
form_definitions_to_update, fields=["configuration"] | ||
) | ||
|
||
|
||
def main(**kwargs): | ||
from openforms.setup import setup_env | ||
|
||
setup_env() | ||
django.setup() | ||
|
||
return fix_softrequired_required_validation(**kwargs) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .celery import app as celery_app | ||
|
||
__all__ = ("celery_app",) | ||
__version__ = "3.0.4" | ||
__version__ = "3.0.5" | ||
__author__ = "Maykin Media" | ||
__homepage__ = "https://github.com/open-formulieren/open-forms" |
Oops, something went wrong.