-
-
-
-
reviewboard/settings.py (Diff revision 1) 'from settings_local import *' used; unable to detect undefined names
Add siteconfig var and button for read-only mode
Review Request #8648 — Created Jan. 20, 2017 and submitted
Information | |
---|---|
khp | |
Review Board | |
master | |
8861, 8824, 8847, 8812, 8657, 8810, 8811, 8677, 8655 | |
7ffda32... | |
Reviewers | |
reviewboard, students | |
Read-only mode is a new feature that allows users to view Review
Board while the site is being maintained or upgraded.
Added a toggle for read-only mode in Admin -> General Settings by
adding a checkbox.
Added a new attribute to siteconfig called site_read_only.
Toggling read-only mode will toggle the attribute to true/false.
In admin panel set new toggle to on/off and check that site_read_only
in siteconfig is set to true or false depending on whether the toggle
is checked or not.
Description | From | Last Updated |
---|---|---|
The description should tell a story about what this feature is for. See https://www.notion.so/reviewboard/Writing-Good-Change-Descriptions-10529e7c207743fa8ca90153d4b21fea. Basically, if I had no idea … |
|
|
The read-only feature should live in reviewboard.admin.features. This isn't specific to review requests. |
|
|
We prefer single quotes for strings wherever possible. |
|
|
This requires us to maintain two lists, which will easily lead to problems down the road. It also means that … |
|
|
As above, we don't need to map this to a setting. |
|
|
Col: 22 E241 multiple spaces after ':' |
![]() |
|
Comments should have a trailing period. |
|
|
If this setting is being managed by siteconfig, we don't actually need a value in settings.py. We put things here … |
|
|
'django_reset' imported but unused |
![]() |
|
'from settings_local import *' used; unable to detect undefined names |
![]() |
|
non-superusers |
|
|
Col: 13 E128 continuation line under-indented for visual indent |
![]() |

-
-
The description should tell a story about what this feature is for. See https://www.notion.so/reviewboard/Writing-Good-Change-Descriptions-10529e7c207743fa8ca90153d4b21fea.
Basically, if I had no idea what read-only mode was already, I wouldn't learn anything from the description. Write the description so that if your friend saw it, they'd know what you're working on.
-
reviewboard/admin/forms.py (Diff revision 1) The read-only feature should live in
reviewboard.admin.features
. This isn't specific to review requests. -
-
reviewboard/admin/forms.py (Diff revision 1) This requires us to maintain two lists, which will easily lead to problems down the road. It also means that if the feature is dynamically enabled/disabled at runtime, the lists will be stale for any existing Apache threads.
There's a way around that, but I want to discuss where Features really come in.
A Feature is something we use to hide functionality from end users, unless the server has opted into it. The Read Only support is a global setting, and one we probably wouldn't ship until it's ready. I don't know that we need to hide it behind a Feature. (David and Barret might disagree -- if so, let's meet and discuss this.)
If we do keep it, what we'd want to do is instead do this check in the form's
__init__
, dynamically removing the field from the instance if the feature is disabled. -
-
-
reviewboard/settings.py (Diff revision 1) If this setting is being managed by siteconfig, we don't actually need a value in
settings.py
. We put things here for modules that expect to read fromsettings
, but anything reading/writing from/to siteconfig can just make use of siteconfig.
Change Summary:
Made changes according to last review.
Summary: |
|
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||
Testing Done: |
|
|||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||
Diff: |
Revision 2 (+9 -1) |

-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py

-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py
-
reviewboard/admin/forms.py (Diff revision 3) Col: 13 E128 continuation line under-indented for visual indent