Fix AccountPage to have default form classes on initial page registration
Review Request #7103 — Created March 22, 2015 and submitted
When an extension uses
AccountPagesHook
with a pre-built list of forms (form_classes
), the listform_classes
is cleared when the extension'sAccountPage
is 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_classes
defined by theAccountPage
with_default_form_classes
, such that the original defined list ofform_classes
will be restored after an extension reload.
Wrote two unit tests which passed alongside existing tests. Also verified that an extension which uses
AccountPagesHook
still shows up in account pages after a reload.
Description | From | Last Updated |
---|---|---|
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 20 E225 missing whitespace around operator |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
I'm really confused by this. We initialize one from the other and vice versa? Can we keep the flow of … |
david | |
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) |
david | |
No period at the end of test case docstrings (nose will add a ... when printing the names) |
david | |
Blank line between after class docstring. |
brennie |
- 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