-
Notifications
You must be signed in to change notification settings - Fork 193
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
Remove Python Code legacy which was used for the old form #3380
Comments
Rewriting the python code will be funkier than I initially thought, because the wizard form code is not entirely independent of the initial form. And there has been duplication in some parts of the code. For example, this defines the original and the wizard form. webcompat.com/webcompat/form.py Lines 91 to 106 in fbaba42
BUT here the wizard form is using the category of the original form webcompat.com/webcompat/form.py Lines 250 to 253 in fbaba42
And this line is also using the old datastructures webcompat.com/webcompat/form.py Line 352 in fbaba42
With a function which expect the 2 values instead of 3 values. webcompat.com/webcompat/form.py Lines 335 to 341 in fbaba42
Fun ahead. |
We currently have form code in
The most important lines on the route webcompat.com/webcompat/views.py Lines 273 to 274 in fbaba42
|
These are breadcrumbs of dead code and useless redirection of variables. Let's remove them before modifying the Form.
This optimizes a bit the code to make it easier to read. It doesn't change the global logic
Originally the list of tuples were 2 items long. but the wizard is using in some cases 3 items long list (because of icons) for radio fields. This leds to the duplication of the list of problem_choices with 2 items and 3 items. So instead of duplicating code, let's handle it in the function itself. There might be something more elegant to do. We can discover that later.
So this is doing a couple of things. - It removes the duplicate problem_choices list of 2 items tuples. - it removes the IssueForm class - it transfers the IssueForm attributes into FormWizard - it reorders in some broad categories the fields for the form - it switches getform to FormWizard. (it was not the case!) - it adjusts the tests
Originally the list of tuples were 2 items long. but the wizard is using in some cases 3 items long list (because of icons) for radio fields. This leds to the duplication of the list of problem_choices with 2 items and 3 items. So instead of duplicating code, let's handle it in the function itself. There might be something more elegant to do. We can discover that later.
So this is doing a couple of things. - It removes the duplicate problem_choices list of 2 items tuples. - it removes the IssueForm class - it transfers the IssueForm attributes into FormWizard - it reorders in some broad categories the fields for the form - it switches getform to FormWizard. (it was not the case!) - it adjusts the tests
Fixes #3380 - Makes Wizard Form the default (python)
The text was updated successfully, but these errors were encountered: