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. This commit adds a decorator that wraps
login_required
. If no arguments are passed into the new
login_required
it will behave the same as django's login_required
.
If a boolean value for redirect_read_only
is set to true, a decorator
that checks whether the user is in read-only mode and should redirect
will be returned.
"New Review Request" and "My Accounts" now redirect to a Read-Only page
and "Register" redirects to "Log-in". Buttons to these pages are
removed for users affected in read-only mode.