Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/settings check #14

Merged

Conversation

MEHRSHAD-MIRSHEKARY
Copy link
Collaborator

No description provided.

…ttings

- validate_str_list: Validates that the provided list contains only strings and optionally checks each item to ensure it represents a valid model when `is_for_model` is `True`.
- validate_custom_field_values: Checks that the custom field values configuration is a dictionary where keys are valid model names and values are dictionaries with existing model fields.
- validate_model_existence: Verifies if the specified model exists within the Django project, helping ensure that model references in configurations are accurate.

Closes Lazarus-org#12
…ngs Validation

Created a `check_data_generator_settings` function that validates key settings in the Django configuration for the Data Generator.
Registered the check function to run on server start, allowing the system to detect and flag any misconfigured settings early.
Integrated the following validation functions:
`validate_str_list` to check lists of strings for settings like `EXCLUDE_APPS` and `EXCLUDE_MODELS`, ensuring values are of correct types and formats.
`validate_custom_field_values` to confirm the accuracy of field-value mappings in `CUSTOM_FIELD_VALUES`, including model and field existence.
Returned a list of errors if any issues are detected, following Django’s error reporting conventions to improve configuration reliability.

Closes Lazarus-org#13
Copy link
Contributor

@ARYAN-NIKNEZHAD ARYAN-NIKNEZHAD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@ARYAN-NIKNEZHAD ARYAN-NIKNEZHAD merged commit 76cf3f3 into Lazarus-org:main Nov 7, 2024
@MEHRSHAD-MIRSHEKARY MEHRSHAD-MIRSHEKARY deleted the feat/settings-check branch November 8, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants