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

Validator form #760

Merged
merged 2 commits into from
Jan 8, 2024
Merged

Validator form #760

merged 2 commits into from
Jan 8, 2024

Conversation

a-belhadj
Copy link
Collaborator

No description provided.

# Survey validators

Survey validators are Python modules that can be added as plugin. It allows users to implement their own validation
logic on a day1 or day2 operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

against all field of the survey instead of only one single field with with the "field_validator"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we want to keep field validator ? Maybe we can stop to maintain field validators and tell users to move on survey validators. They are more user friendly and you can use the same code for both UI and API.

If we decide to stop field validators in X months, we should not include a citation here. Need to discuss

Comment on lines 91 to 92
if squest_stars_on_github <= 250:
self.fail("Number of stars on Squest is below 250, come back when it's 251")
Copy link
Contributor

Choose a reason for hiding this comment

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

not a really good example :)


## Fix

- Hide disabled operations from Instance view
Copy link
Contributor

Choose a reason for hiding this comment

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

and the line that correspond to this feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


from rest_framework.exceptions import ValidationError

logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

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

already in the file.

@a-belhadj a-belhadj force-pushed the validator_form branch 3 times, most recently from e803787 to 7aad5bb Compare January 8, 2024 09:39
@a-belhadj a-belhadj force-pushed the validator_form branch 2 times, most recently from 79a2a3b to 1f8b63e Compare January 8, 2024 12:50
@@ -341,6 +341,12 @@ Change the format of all date in Squest UI. Based on Python [strftime](https://s

Path to form field validation modules.

### SURVEY_VALIDATOR_PATH
Copy link
Contributor

Choose a reason for hiding this comment

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

add deprecation warning on the other field

@Sispheor Sispheor merged commit 5a9e3cd into HewlettPackard:dev Jan 8, 2024
2 checks passed
@a-belhadj a-belhadj deleted the validator_form branch January 29, 2024 09:06
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.

3 participants