Respond to API requests with 503 when read-only mode

Review Request #8657 - Created Jan. 21, 2017 and updated

Kanghee Park
Review Board
master
8648
8810, 8861, 8811, 8812, 8824, 8847, 8677
e04ec08...
reviewboard, students

Read-only mode is a setting an admin can enable to prevent writes to
the database. This can be used when the site is under maintenence or
being upgraded. The previous commit added the siteconfig attribute and
a checkbox to toggle the mode. This commit adds a new 503 error to
Review Board's webapi. Furthermore, all requests that hit RB's API
using PUT, POST, DELETE methods while read-only mode is on, and
the user is not a superuser, will return the new 503 error. A utility
file read_only.py has been added which deals with the logic and
caching of determining when a user should be affected by read-only
mode.

Added new Python unit tests that send API requests as superuser and
non-superuser
Ran the Python unit test suite
Check that modifying/deleting review requests and comments works
properly

  • 0
  • 20
  • 1
  • 21
Description From Last Updated
Review Bot
Barret Rennie
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Barret Rennie
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Barret Rennie
Christian Hammond
Christian Hammond
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Kanghee Park
Barret Rennie
Kanghee Park
Review request changed

Checks run (3 succeeded)

JSHint passed.
Pyflakes passed.
PEP8 Style Checker passed.
Loading...