Fix AccountPage to have default form classes on initial page registration
Review Request #7103 — Created March 22, 2015 and submitted
When an extension uses
AccountPagesHookwith a pre-built list of forms (form_classes), the listform_classesis cleared when the extension'sAccountPageis unregistered after the extension reloads. This causes the extension'sAccountPage(s) to not show up in the account page after.This fix keeps track of the initial
form_classesdefined by theAccountPagewith_default_form_classes, such that the original defined list ofform_classeswill be restored after an extension reload.
Wrote two unit tests which passed alongside existing tests. Also verified that an extension which uses
AccountPagesHookstill shows up in account pages after a reload.
| Description | From | Last Updated |
|---|---|---|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 20 E225 missing whitespace around operator |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
I'm really confused by this. We initialize one from the other and vice versa? Can we keep the flow of … |
|
|
|
Since we are comparing between empty or not empty list, I think this is possible as well. elif not page_cls.form_classes: |
XU xuanyi | |
|
No period at the end of test case docstrings (nose will add a ... when printing the names) |
|
|
|
No period at the end of test case docstrings (nose will add a ... when printing the names) |
|
|
|
Blank line between after class docstring. |
|
- Change Summary:
-
I thought it was 80, not 79.
- Commit:
-
a36bfc7de3c618af166d5887d0312e4f5f23899675261225ee10f92bdec523a8c18a8d8d359e82d2
-
Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py Tool: Pyflakes Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py
- Change Summary:
-
Fix syntax and separate if-elif block.
- Commit:
-
75261225ee10f92bdec523a8c18a8d8d359e82d27dde823091e5aab88326d05c3a2dda8edc54dd31
-
Tool: Pyflakes Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py
- Change Summary:
-
Add blank line
- Commit:
-
7dde823091e5aab88326d05c3a2dda8edc54dd314a5e1102bde9e24fa1fae0d383490b2edadb5ac2
Tool: Pyflakes Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/tests.py reviewboard/accounts/pages.py